I have a scheduled task that starts a batch script that runs robocopy every hour. Every time it runs a window pops up on the desktop with robocopy's output, which I don't really want to see. You could run it silently using a Windows Script file instead. The Run Method allows you running a script in invisible mode. Create a. The second argument in this example sets the window style.
Complete syntax of the Run method :. Are you running this as a scheduled task? If so set it to run as a different user account then it won't be visible to the logged on user. You could also try CHP Create hidden process , does exactly what you'd think Runs with no command window. CMDOW is an awsome tool that allows you to do many, many things to windows from the command line. One of the simplest things to do is hide the current window usually as a first line in the bat file with:. You can create a shortcut to the batch file, set the shortcut to start minimized in the shortcut's properties, 'Shortcut' tab , and then set the job to start the shortcut.
Important : You'll need to specify the path to the shortcut manually by typing it into the Run text field, complete with the '. I realize this question has already been answered with a perfectly good resolution that is native to Windows and thus should be the most compatible, and I agree completely.
I also wanted to say that I disagree with splattne's comment but not his actual answer -- that the resolution in the other referenced thread deserves the credit. That answer involves running the script as a different user SYSTEM , which is pretty much the equivalent of giving the script root access. I have never tried CMDOW before, but I would like to offer another similar resolution, which [although is not natively-installed on Windows] is still highly-portable to most versions, and comes in both 32 and bit versions, and that is NirCmd.
NirCmd is a very powerful tool that has myriads of options, the most useful of which, I personally find to be its ability to launch hidden command windows by simply executing the following:. Runs an application, and optionally specify one or more command-line parameters for the executed application. If 'hide' is specified, the running application won't be visible to the user. If 'max' is specified, the running application window will be maximized. If 'min' is specified, the running application window will be minimized.
I tried double-clicking the script and could not get it to work, but could only get it to run under an elevated command prompt. I did create a shortcut to the batch file and have it run as Administrator and was able to get it execute by double-clicking it, but the method I ended up going with was to run it hidden as SYSTEM I know, I know -- but it does work with ROBOCOPY , for what it's worth, as long as the batch file has the correct permissions.
Another solution I've used is Hidden Start. Try putting in an exit command at the end of your batch file. This should close the command window when the script is done.
Sign up to join this community. The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Learn more. Run a. Asked 12 years, 8 months ago. It's not an obvious solution, but to make a Scheduled Task run in the background, change the User running the task to " SYSTEM ", and nothing will appear on your screen.
Assuming the application you are attempting to run in the background is CLI based, you can try calling the scheduled jobs using Hidden Start. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. How do I set a Windows scheduled task to run in the background?
Asked 10 years, 6 months ago. Active 2 years, 2 months ago. Viewed k times. Improve this question. Samuel Liew. Here I've tried to compile all possible ways to start a hidden process on windows without external tools. Including a script that schedule a task. AlexS - check this one — npocmaka.
Maybe will help somebody: howtogeek. If you are running PowerShell script, here is the solution superuser. Add a comment. Active Oldest Votes. So I updated my initial post. If anything strikes your mind that could help me resolve the problem, please share it. Office Office Exchange Server. Not an IT pro? Resources for IT Professionals. Sign in. United States English. Ask a question. Quick access. Search related threads.
Remove From My Forums. Answered by:. Archived Forums. Windows Server General Forum.
0コメント