Create a batch file to run an .exe with an additional parameter

in batch file abc.bat cd c:\user\ben_dchost\documents\ executible.exe -flag1 -flag2 -flag3 I am assuming that your executible.exe is present in c:\user\ben_dchost\documents\ I am also assuming that the parameters it takes are -flag1 -flag2 -flag3 Edited: For the command you say you want to execute, do: cd C:\Users\Ben\Desktop\BGInfo\ bginfo.exe dc_bginfo.bgi pause Hope this helps

My Batch File keeps looping, but why?

In Windows, if you have a command line executable with the same name as your bat filename, and the batch file contains this command, the batch file keeps looping since Windows will execute that .bat file instead of the Windows command. Example: Create the file net.bat on your desktop. In your file, write this text: … Read more

How can I verify that a string is a valid IPv4 or IPv6 address in batch?

Check for valid IPv4: @if (@X)==(@Y) @end /* JScript comment @echo off cscript //E:JScript //nologo “%~f0” %* exit /b %errorlevel% @if (@X)==(@Y) @end JScript comment */ WScript.Quit(ValidateIPaddress(WScript.Arguments.Item(0))); function ValidateIPaddress(ipaddress) { return !(/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(ipaddress)) } For valid IPv6 address: @if (@X)==(@Y) @end /* JScript comment @echo off cscript //E:JScript //nologo “%~f0” %* exit /b %errorlevel% @if (@X)==(@Y) … Read more

How can a batch file run a program and set the position and size of the window?

Here is an alternate way with nircmd util from http://www.nirsoft.net/utils/nircmd.html Examples: nircmd win move ititle “cmd.exe” 5 5 10 10 nircmd win setsize ititle “cmd.exe” 30 30 100 200 nircmd cmdwait 1000 win setsize ititle “cmd.exe” 30 30 1000 600 Here are the contents of SetEnv.cmd: Explorer /n,c:\develop\jboss-4.2.3.GA\server\default\deploy nircmd wait 1000 win setsize ititle “something” … Read more

Open a URL without using a browser from a batch file

If all you want is to request the URL and if it needs to be done from batch file, without anything outside of the OS, this can help you: @if (@This==@IsBatch) @then @echo off rem **** batch zone ********************************************************* setlocal enableextensions disabledelayedexpansion rem The batch file will delegate all the work to the script engine … Read more