vbscript / html

vbscript / html - VB/VBA/VBS - Programmation

Marsh Posté le 31-08-2004 à 18:07:06    

Voila, j'ai fais ca:
 

Code :
  1. <input type="button" value="connection PT" id="bouton">
  2. <script language="VBScript">
  3. Sub bouton_onclick
  4. dim wsh, fso, f
  5. set wsh = CreateObject("WScript.Shell" )
  6. set fso = CreateObject("Scripting.FileSystemObject" )
  7. set f = fso.GetFile("c:\PTW525\pt525.exe" )
  8. wsh.Run f.ShortPath
  9. end sub
  10. </script>


 
Mais il faudrait que je puisse lancer "c:\PTW525\pt525.exe" avec des parametres.......
 
Le tout est dans une page html...
Voila, je suis bloqué....
Merci d'avance.
 
Exemple : "c:\PTW525\pt525.exe telnet.psl machine toto"

Reply

Marsh Posté le 31-08-2004 à 18:07:06   

Reply

Marsh Posté le 31-08-2004 à 19:13:11    

Code :
  1. wsh.Run f.ShortPath & "telnet.psl machine toto"


Message édité par leneuf22 le 31-08-2004 à 19:13:48
Reply

Marsh Posté le 01-09-2004 à 09:37:27    

Ca ne fonctionne pas.  
 
code :
 
<input type="button" value="connection PT" id="bouton">
 
<script language="VBScript">
Sub bouton_onclick
dim wsh, fso, f
set wsh = CreateObject("WScript.Shell" )
set fso = CreateObject("Scripting.FileSystemObject" )
set f = fso.GetFile("c:\PTW525\pt525.exe" )
wsh.Run f.ShortPath & ("telnet.psl" )
end sub
</script>

Reply

Marsh Posté le 01-09-2004 à 13:25:28    

hornetmen a écrit :

Ca ne fonctionne pas.  


 
un ptit espace :
 

Code :
  1. <input type="button" value="connection PT" id="bouton">
  2. <script language="VBScript">
  3. Sub bouton_onclick
  4. dim wsh, fso, f
  5. set wsh = CreateObject("WScript.Shell" )
  6. set fso = CreateObject("Scripting.FileSystemObject" )
  7. set f = fso.GetFile("c:\PTW525\pt525.exe" )
  8. wsh.Run f.ShortPath & " telnet.psl"
  9. end sub
  10. </script>


Message édité par leneuf22 le 01-09-2004 à 13:25:50
Reply

Marsh Posté le 01-09-2004 à 14:00:10    

leneuf22 a écrit :

un ptit espace :
 

Code :
  1. <input type="button" value="connection PT" id="bouton">
  2. <script language="VBScript">
  3. Sub bouton_onclick
  4. dim wsh, fso, f
  5. set wsh = CreateObject("WScript.Shell" )
  6. set fso = CreateObject("Scripting.FileSystemObject" )
  7. set f = fso.GetFile("c:\PTW525\pt525.exe" )
  8. wsh.Run f.ShortPath & " telnet.psl"
  9. end sub
  10. </script>




Merci à toi, cela fonctionne bien.
 
Pour info, j'avais solutionner le pb en faisant cela :
 

Code :
  1. <input type="button" value="toto" id="bouton1">
  2. <script language="VBScript">
  3. Sub bouton1_onclick
  4. Dim oShell
  5. Set oShell = CreateObject ("WSCript.shell" )
  6. oShell.run "cmd /C cd C:\PTW525 & pt525.exe telnet.psl server"
  7. end sub
  8. </script>


 
Par contre, je suis obligé d'utiliser CMD.EXE pour garder le path vers le programme  :sarcastic:

Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed