-
September 11th, 2010, 11:09 AM
#1
WScript.Shell Run
Heya,
I have the following codeing in a .vbs file.
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run chr(34) & "C:\Test.exe" & Chr(34), 0
Set WshShell = Nothing
Running this code excutes the test.exe hiding the promopt but without 3 paramters the exe fails. Normally this could be passed by a .bat or shortcut such as
Shortcut "C:\Test.exe" 10 1024 1024
Bat Start C:\Test.exe 10 1024 1024.
Could anyone tell me how i could put these 3 numbers into the vbs coding so my .exe will work.
-
September 11th, 2010, 12:30 PM
#2
Re: vbscript WshShell.Run Parameter
If you want to hard-code, it's easy. Otherwise, use your program to WRITE a Batch File, then execute it.
Code:
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run chr(34) & "C:\Test.exe 1 2 3" & Chr(34), 0
Set WshShell = Nothing
-
September 11th, 2010, 05:40 PM
#3
Re: WScript.Shell Run
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
September 13th, 2010, 09:52 AM
#4
Re: WScript.Shell Run
You can give arguments to your VBS file and pass them to test.exe:
Code:
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run chr(34) & "C:\Test.exe " & WScript.Arguments.Item(0) & " " & WScript.Arguments.Item(1) & " " & WScript.Arguments.Item(2) & Chr(34), 0
Set WshShell = Nothing
-
September 13th, 2010, 05:25 PM
#5
Re: WScript.Shell Run
That doesn't say how to use them.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|