troubleshooting Question

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

Avatar of llarava
llaravaFlag for Afghanistan asked on
VB ScriptWindows BatchShell Scripting
5 Comments2 Solutions2666 ViewsLast Modified:
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

ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 2 Answers and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros