How do you loop in a Windows batch file?
What is the syntax for a FOR loop in a Windows batch file? 8 Answers 8
What is the syntax for a FOR loop in a Windows batch file? 8 Answers 8
This batch file releases a build from TEST to LIVE. I want to add a check constraint in this file that ensures there is an accomanying release document in a specific folder. “C:\Program Files\Windows Resource Kits\Tools\robocopy.exe” “\\testserver\testapp$” “\\liveserver\liveapp$” *.* /E /XA:H /PURGE /XO /XD “.svn” /NDL /NC /NS /NP del “\\liveserver\liveapp$\web.config” ren “\\liveserver\liveapp$\web.live.config” web.config So … Read more
The Windows FINDSTR command is horribly documented. There is very basic command line help available through FINDSTR /?, or HELP FINDSTR, but it is woefully inadequate. There is a wee bit more documentation online at https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/findstr. There are many FINDSTR features and limitations that are not even hinted at in the documentation. Nor could they … Read more
I’m trying to open a new command window in a BAT file: start %windir%\system32\cmd.exe After it opens, I’d like to execute a BAT command in the new window: echo “test in new window” How can I do this? 9 Answers 9
Say, if I have foo.exe bar.exe baz.exe How do I run all of them from a batch file asynchronously, i.e. without waiting for the previous program to stop? 7 Answers 7
I am trying to write a batch file for my users to run from their Vista machines with UAC. The file is re-writing their hosts file, so it needs to be run with Administrator permissions. I need to be able to send them an email with a link to the .bat file. The desired behavior … Read more
I want to get the name of the currently running batch file without the file extension. Thanks to this link, I have the file name with the extension… but what is the best way to do a substring in a batch file? Or is there another way to get the file name w/o the extension? … Read more
Can somebody remember what was the command to create an empty file in MSDOS using BAT file? 13 Answers 13
I have a storage folder on a network in which all users will store their active data on a server. Now that server is going to be replaced by a new one due to place problem so I need to copy sub folders files from the old server storage folder to new server storage folder. … Read more
How would you implement logical operators in DOS Batch files? 14 Answers 14