Can somebody please give me a VB Script that I can use to run this Win
32 executable to hide the CMD window from appearing.
Thanks
Karen
Pseudo code follows...
Option Explicit
Dim objWSS
Set objWSS = CreateObject("WScript.Shell")
objWSS.Run "%comspec% /c your_exe your_parms, 1, true
Set objWSS = Nothing
"your_exe" should include the path if the script isn't in the same folder.
"your_parms" are optional.
"/k" instead of /c will keep the window open.
Hi
0 as the second parameter to the Run method will archive this:
'--------------------8<----------------------
Set oShell = CreateObject("WScript.Shell")
' add quotes around the path because of spaces in it
oShell.Run "cacls.exe ""c:\my test"" /E /G user:F", 0, True
'To redirect the output from cacls to a file (c:\logs\cacls.txt)
' you will need to use %comspec% /c:
oShell.Run "%comspec% /c cacls.exe ""c:\my test"" >c:\logs\cacls.txt", 0, True
'--------------------8<----------------------
The third parameter (True in the example above) will decide if the
script will wait for the command to finish before continuing.
WSH 5.6 documentation (local help file) can be downloaded
from here if you haven't got it already:
http://msdn.microsoft.com/downloads/list/webdev.asp
--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx