Hide Dos Box/Window.

  • Thread starter Thread starter BaKaR
  • Start date Start date
B

BaKaR

Hi!

Im need to run a batch script (*.cmd) with AT or SCHTASKS (using SCHTASKS in the moment).
Those scripts are performing some checks, etc.

I dont know how to hide a cmd box/window from pop uping every time schtashs/at initiate the script.

Also, im using ShowWindow() + SW_Hide in VC++ for some of my scripts/proggyz but it still pops up for a second.

Any Ideas ?

Its giving me a headache in a daily working hours.

Thank You.
 
Hi!

Im need to run a batch script (*.cmd) with AT or SCHTASKS (using SCHTASKS in the moment).
Those scripts are performing some checks, etc.

I dont know how to hide a cmd box/window from pop uping every time schtashs/at initiate the script.

Also, im using ShowWindow() + SW_Hide in VC++ for some of my scripts/proggyz but it still pops up for a second.

Any Ideas ?

Its giving me a headache in a daily working hours.

Thank You.

Create an Administrative account with a password that never expires and that you
never log on to.

Schedule the task to run in the new account.

Since it is NOT running in the context of the logged on user, it will run in the
background.


Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com
 
Another way if you need to run the script from a specific user account is to
wrap it in a WSH container that runs the cmd script in a hidden window,
something like this:

'MyScript.vbs
Set WshShell = WScript.CreateObject("WScript.Shell")
Runstring = "%comspec% /c c:\bin\MyScript.cmd"
Return = WshShell.Run(RunString, 0, TRUE)
Set WshShell = Nothing

It's only a little more complex if you need to pass it arguments. I use this
method for automated ftp and a few other things.


BaKaR said:
Hi!

Im need to run a batch script (*.cmd) with AT or SCHTASKS (using SCHTASKS in the moment).
Those scripts are performing some checks, etc.

I dont know how to hide a cmd box/window from pop uping every time
schtashs/at initiate the script.
Also, im using ShowWindow() + SW_Hide in VC++ for some of my
scripts/proggyz but it still pops up for a second.
 
Back
Top