Hide Dos Box/Window.

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.
 
J

Jerold Schulman

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
 
P

Paul R. Sadowski

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top