Logical operators (“and”, “or”) in DOS batch
How would you implement logical operators in DOS Batch files? 14 Answers 14
How would you implement logical operators in DOS Batch files? 14 Answers 14
How can I script a bat or cmd to stop and start a service reliably with error checking (or let me know that it wasn’t successful for whatever reason)? 18 Answers 18
Is there a Windows command line command that I can use to get the full path to the current working directory? Also, how can I store this path inside a variable used in a batch file? 14 Answers 14
I want to display the content of a text file in a CMD window. In addition, I want to see the new lines that added to file, like tail -f command in Unix. 14 Answers 14
How do I check if the current batch script has admin rights? I know how to make it call itself with runas but not how to check for admin rights. The only solutions I’ve seen are crude hack jobs or use external programs. Well, actually I don’t care if it is a hack job as … Read more
I need to assign the output of a program to a variable using a MS batch file. So in GNU Bash shell I would use VAR=$(application arg0 arg1). I need a similar behavior in Windows using a batch file. Something like set VAR=application arg0 arg1. 10 Answers 10
I know that there is a post similar to this : here. I tried using the comp command like it mentioned, but if I have two files, one with data like “abcd” and the other with data “abcde”, it just says the files are of different sizes. I wanted to know where exactly they differ. … Read more
Say, there is a variable called %pathtofolder%, as it makes it clear it is a full path of a folder. I want to delete every single file and subfolder in this directory, but not the directory itself. But, there might be an error like ‘this file/folder is already in use’… when that happens, it should … Read more
I work with multiple projects, and I want to recursively delete all folders with the name ‘bin’ or ‘obj’ that way I am sure that all projects will rebuild everything (sometimes it’s the only way to force Visual Studio to forget all about previous builds). Is there a quick way to accomplish this (with a … Read more
How can I open a cmd window in a specific location without having to navigate all the way to the directory I want? 42 Answers 42 This might be what you want: cmd /K “cd C:\Windows\” Note that in order to change drive letters, you need to use cd /d. For example: C:\Windows\System32\cmd.exe /K “cd … Read more