About 53 results
Open links in new tab
  1. Windows batch files: .bat vs .cmd? - Stack Overflow

    Sep 29, 2008 · If both .bat and .cmd versions of a script (test.bat, test.cmd) are in the same folder and you run the script without the extension (test), by default the .bat version of the script will run, even …

  2. Using parameters in batch files at Windows command line

    In Windows, how do you access arguments passed when a batch file is run? For example, let's say I have a program named hello.bat. When I enter hello -a at a Windows command line, how do I let my

  3. Logical operators ("and", "or") in Windows batch - Stack Overflow

    Jan 26, 2010 · Note that this answer is tailored toward cmd batch language, the one found in Windows. You mention "DOS batch" but, based on several points, I think the former choice is a safe bet (1). If …

  4. Bat file to run a .exe at the command prompt - Stack Overflow

    Oct 21, 2008 · A bat file has no structure...it is how you would type it on the command line. So just open your favourite editor..copy the line of code you want to run..and save the file as whatever.bat or …

  5. BAT file: Open new cmd window and execute a command in there

    There is one more diff between /k and /c. If you're using /c the new terminal window name is the same as the standard one, smth like "c:\Windows\system32\cmd.exe". but in case of /k it corresponds to …

  6. How can I run a program from a batch file without leaving the console ...

    May 4, 2018 · For the moment my batch file look like this: myprogram.exe param1 The program starts but the DOS Window remains open. How can I close it?

  7. Safest way to run BAT file from Powershell script

    Dec 18, 2013 · I can not get a powershell script to execute a bat file directly. For example, this works on the command line: .\\my-app\my-fle.bat When I add this command to a script, it outputs: The term '.\\m...

  8. How to call a Windows batch file from another one or from prompt?

    Mar 27, 2026 · The batch file will be executed by the current cmd.exe instance (or a new cmd.exe instance if, for instance, double-clicked in Explorer). Same as #1, only has an effect when used …

  9. windows - How can I debug a .BAT script? - Stack Overflow

    Oct 3, 2008 · Like whatever.bat >log.txt You have to make sure that in this case, every other called script is also logging to the file like >>log.txt Also, if you put a date /T and time /T in the beginning …

  10. Windows Bat file optional argument parsing - Stack Overflow

    Oct 20, 2010 · I need my bat file to accept multiple optional named arguments. mycmd.bat man1 man2 -username alice -otheroption For example my command has 2 mandatory parameters, and two …