Create Batch File to Run EXESave your file with the file extension . bat , e.g. run-exe-program. bat and double click on it to run the .exe program.
Type "start [filename.exe]" into Command Prompt, replacing "filename" with the name of your selected file. Replace "[filename.exe]" with your program's name. This allows you to run your program from the file path.
You can test command line arguments by running an executable from the "Command Prompt" in Windows or from the "DOS prompt" in older versions of Windows. You can also use command line arguments in program shortcuts, or when running an application by using Start -> Run. This will start notepad with a blank document.
To start a program and then close command prompt without waiting for program to exit:
start /d "path" file.exe
You can use:
start "windowTitle" fullPath/file.exe
Note: the first set of quotes must be there but you don't have to put anything in them, e.g.:
start "" fullPath/file.exe
it is very simple code for executing notepad bellow code type into a notepad and save to extension .bat Exapmle:notepad.bat
start "c:\windows\system32" notepad.exe
(above code "c:\windows\system32" is path where you kept your .exe program and notepad.exe is your .exe program file file)
enjoy!
Just put that line in the bat file...
Alternatively you can even make a shortcut for svcutil.exe, then add the arguments in the 'target' window.
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 whatever.cmd
Just stick in a file and call it "ServiceModelSamples.bat" or something.
You could add "@echo off" as line one, so the command doesn't get printed to the screen:
@echo off
svcutil.exe /language:cs /out:generatedProxy.cs /config:app.config http://localhost:8000/ServiceModelSamples/service
If you want to be real smart, at the command line type:
echo svcutil.exe /language:cs /out:generatedProxy.cs /config:app.config http://localhost:8000/ServiceModelSamples/service >CreateService.cmd
Then you have CreateService.cmd
that you can run whenever you want (.cmd
is just another extension for .bat
files)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With