The tag has no wiki summary.

learn more… | top users | synonyms

79
votes
8answers
121k views

Run a .bat file in a scheduled task without a window

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. I ...
17
votes
13answers
45k views

How to get a list of drive letters on a system through a windows shell (bat, cmd)?

How do I get a list of drive letters and their associated labels on a windows system through a bat file?
9
votes
4answers
18k views

System error 1219 has occurred

I am trying to connect to a remote server and deploy a service there, through a deploy script. I start by stating "Net use" and send the credentials for the server. But here I get system 1219 error: ...
5
votes
2answers
3k views

Windows: How do I add a program to the system's path environmental variable from the command line?

I'm looking to permanently add a directory to the %PATH% environmental available on a large number of Windows machines. Is there any way to do this from a command line (cmd) so I can script up a ...
5
votes
1answer
5k views

Looking to add the “Log On as a service” right to an account via the command line

I am looking to make a user from the command line with minimal rights to run a service. cmd.exe or powershell.exe are both options, but cmd.exe is preferable. So far I got this: net user /add ...
2
votes
4answers
6k views

How to run an elevated command prompt from the command prompt?

I have remotely connected to a Windows 7 computer via psexec and am running a remote command prompt on the Windows 7 computer. The command I am trying to execute requires that it be run in an elevated ...
11
votes
5answers
3k views

What's the difference between .cmd and .bat files?

Just curious. "Cool" people in our company always use *.cmd while no one was able to explain the difference to me.
0
votes
2answers
2k views

Windows Command SC, how to check errorlevel

I'm looking for a way to check the returncode / errorlevel of the SC command in a DOS script. How can I get this information ?