batch files are simple text files executed in a command to achieve a particular task or a set of tasks

learn more… | top users | synonyms

26
votes
3answers
46k views

How to sleep in a batch file?

How to pause execution for a while in a Windows batch file between a command and the next one?
6
votes
6answers
16k views

Delete temporary files from batch script in xp

I'm looking for a good batch script that would quickly find & clean all the known safe temporary folders/files from Windows (as many variants as possible) machines (e.g. the windows temp folder, ...
1
vote
6answers
10k views

How do I run a batch file on a local network as Administrator? (Vista)

I have a couple of batch files which must be run as Administrator. I can do so if they are on my machine, but when I put them on the network and then try to run them as Administrator, the command ...
0
votes
4answers
816 views

FTP from batch file

I'm trying to use a batch file to download a package off my FTP server. echo username >ftp.txt echo >>ftp.txt echo cd directory >>ftp.txt echo get filename >>ftp.txt ftp ...
1
vote
0answers
304 views

How do i create a bat file to create user directory with proper rights and a script to reset it if something goes wrong

I need to create user and directories for the user and share it. The rights are set on NTFS structure only. The user must do all except change rights and take ownership this is not allowed and this ...
1
vote
1answer
1k views

Change list of allowed logon computers from batch file

How can I change this setting from a batch file? For any given user, how can I make it so they can only log onto the computer named abc? A vbs or powershell script would be my second choice.
1
vote
4answers
2k views

Why isn't my Scheduled Task running a batch script?

OS: Windows 2003 Server Setup: The batch file basically uses 7zip to zip up a few files into a location ready for uploading into an offsite location via FTP. I have run the batch file as myself and ...
10
votes
8answers
83k views

How to create a service running a .bat file on Windows 2008 Server?

I've created the service using sc create myService binpath=myservice.bat But when I start it, it fails with the following error message: [SC] StartService FAILED 1053: The service did not ...
16
votes
13answers
44k 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?
11
votes
8answers
32k views

Better way to wait a few seconds in a bat file? [duplicate]

Possible Duplicate: How to sleep in a batch file? Here's a haxxorish way to pause for a second in a batch file: PING 400.500.600.700 > NUL I've googled but I'm not sure there are any ...
6
votes
2answers
5k views

Scheduled Tasks w/ GUI issue

Are there issues running Scheduled Tasks in Windows 2003 when the task has a GUI? I have one that worked fine in Windows 2000 but won't run on Windows 2003. Details: I have a .bat job that ran every ...
1
vote
6answers
2k views

How to rename machines after image install

Today I am deploying 20 brand new Dell workstations. These will all be for public use at a local library and will be replacing 20 older workstations, which will be moved to another branch of the ...
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.
3
votes
2answers
10k views

How can I edit local security policy from a batch file?

I am trying to write a utility as a batch file that, among other things, adds a user to the "Deny logon locally" local security policy. This batch file will be used on hundreds of independent ...
2
votes
1answer
103 views

PsExec hangs intermittently when calling AppCmd

We have an automated deployment process which is primarily managed by a batch file. One of the first steps in that process is to stop an IIS AppPool so the updated files can be safely copied. To do ...
2
votes
4answers
4k views

Pass the PID from tasklist into taskkill to kill a process by the .dlls it's holding open

Windows scripting noob here. Say I've got the name of a .dll I need to delete or copy over, and I'm getting the classic "The file is in use by another process..." error. I know I can run tasklist with ...
1
vote
3answers
4k views

Store output of Windows command in batch file

I need to store the output of a command line in a variable. How can I do this?
1
vote
1answer
1k views

How to revert the compressed attribute on files in Windows for a whole drive

Someone at my job (a sysadmin) actually performed a "cleanup" task on WinXP which at the same time compressed all the files on my HDD with the Windows compressed file attribute (Filenames get blue in ...
1
vote
1answer
2k views

Using XCACLS to set permissions with long filenames

We need to set permissions on users' directories on a Windows 2000 Server. This happens regularly enough and they must also be set in the order below or the backups crap out. This is the basic script: ...
0
votes
3answers
3k views

how to get default gateway of certain adapter in windows bat?

Please see below ipconfig output in windows. C:>ipconfig Windows IP Configuration Ethernet adapter Local Area Connection 11: Connection-specific DNS Suffix . : Link-local IPv6 Address . ...
0
votes
2answers
2k views

Windows command line built-in compression/extraction tool?

I need to write a batch file to unzip files to their current folder from a given root folder. Folder 0 |----- Folder 1 | |----- File1.zip | |----- File2.zip | ...