Invoke EXE from batch file *without* waiting
Use “start“. Type “start /?” at a command prompt.
Use “start“. Type “start /?” at a command prompt.
RENAME *.txt.deploy *. A more ‘fancy’ solution: @ECHO OFF FOR %%f IN (*.txt.deploy) DO RENAME “%%f” “%%~nf”
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
Turn echo off to suppress showing the command being run, and redirect output to null as @Sico suggested. @echo off del /s *.jpg >nul 2>&1 You should see nothing displayed when the bat file is run.
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
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
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
You can use the double quotation mark as a delimiter with syntax like: FOR /F delims^=^”^ tokens^=2 %G IN (‘echo I “want” a “pony”‘) DO @ECHO %G When run on the command line, using tokens^=2 should give you want, and 4 tokens gets you a pony. Applying the technique to your original question, this should … Read more
if exist *.txt del *.txt
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