When running "objShell.Run + command" how do we hide the cmd.exe window so it doesn't show up?

From the folloowing script is there any way to hide the cmdshell screen (cmd.exe) so the user doesn't see the black window with what is being executed. (Notice that this is going to be part of the logon script)

Basically with this code the cmd.exe appear while the users are doing the logon and I would like to hide (so they can't close it or know that even exist)

objShell.Run "\\server\NETLOGON\tranguid.exe", 1, True
objShell.Run "net Stop ccmexec", 1, True
Wscript.Sleep intShortSleep
objShell.Run "net Start ccmexec", 1, True

Set objShell = CreateObject("WScript.Shell")  
Set objFSO = CreateObject("Scripting.FileSystemObject")  
strRegFile = "\\server\NETLOGON\tranguid /r.exe" 
Dim intShortSleep 
 
' Values set 
intShortSleep = 3000 
   
objShell.Run "\\server\NETLOGON\tranguid.exe", 1, True 
objShell.Run "net Stop ccmexec", 1, True 
Wscript.Sleep intShortSleep 
objShell.Run "net Start ccmexec", 1, True

Open in new window

llaravaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Om PrakashCommented:
http://blogs.technet.com/heyscriptingguy/archive/2006/05/19/how-can-i-hide-the-command-window-when-executing-a-command-like-net-localgroup-administrators.aspx
Set objShell = CreateObject("Wscript.Shell")
strCommand = "net localgroup Administrators" 

Set objExec = objShell.Exec(strCommand) 
   
Do Until objExec.Status
    Wscript.Sleep 250
Loop 

Wscript.Echo objExec.StdOut.ReadAll()

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
llaravaAuthor Commented:
I am not quite sure how to integrate that into the script could someone help?
0
llaravaAuthor Commented:
I have tried this but it doesn't seem to work I don't get any errors but it doesn't seem to do what work.

Basically the script needs to:

1.) Execute the tranguid /r.exe on a remote share

2.) Stop ccmexec service

3.) Allow some time

4.) Start ccmexec

Any help?

Thanks.
Set objShell = CreateObject("WScript.Shell")   
Set objFSO = CreateObject("Scripting.FileSystemObject")   
strRegFile = "\\server\NETLOGON\tranguid /r.exe"
strnetstop = "net Stop ccmexec"   
strnetstart = "net Start ccmexec"  
   
Set objExec = objShell.Exec(strRegFile)  
    
Do Until objExec.Status 
    Wscript.Sleep 250 
Loop  
 
'Wscript.Echo objExec.StdOut.ReadAll()

Set objExec = objShell.Exec(strnetstop)  
    
Do Until objExec.Status 
    Wscript.Sleep 250 
Loop  
 
Wscript.Echo objExec.StdOut.ReadAll()


'Set objExec = objShell.Exec(strnetstart)  
    
'Do Until objExec.Status 
'    Wscript.Sleep 250 
'Loop  
 
'Wscript.Echo objExec.StdOut.ReadAll()

Open in new window

0
llaravaAuthor Commented:
I modified the script an used to hide the window.

objShell.Run "net Stop ccmexec", 0, True
0
merowingerCommented:
This is the correct option!
0 = Hide the executed application
true = script waits until the application is finished (wait = in the case the script continues with waitiing for the appliction)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.