6
4
Is there an easy way to launch an application from Windows Explorer with arguments? Or do I have to actually run them from the command line?
6
4
Is there an easy way to launch an application from Windows Explorer with arguments? Or do I have to actually run them from the command line?
9
If you open any folder, then the shortest way to run any application with arguments is just typing program name and arguments in the upper textbox.
Otherwise, if your program is on Desktop, you can use various ways such as:
Win+R
, write cmd.exe /k cd desktop
, hit enter, write
program name and arguments.cmd.exe /k cd %systemdrive%\%username%\desktop
4
It sounds like you want a brief script that you can just double-click to run a command with certain arguments - is that right? If it is, here's one way:
Open a simple text editor, like Notepad, and type in the commands with the arguments you want it to take, like so:
cd %USERPROFILE%\useful-files\executables
putty.exe 192.168.2.10
(In this example, putty.exe is a program that can take IP addresses as arguments, and it's saved in C:\Users\\useful-files\executables.) When you're done, save it with the .bat
extension (if you're using Notepad, just make sure you replace the .txt
it starts you off with; in our example, we could save it as something like run-putty-with-IP.bat
).
If you've done this correctly, in File Explorer it will show the file type as "Windows Batch File" and double-clicking it will run its contents.
Note that certain programs, without configuring system or environment variables, will require you to change to their directory to be able to execute them, hence the cd
command included here.
how to quit the command window (started by the bat) afterwards ? – Liviu – 2017-05-31T08:55:19.790
1Thanks. This is a good answer, but I was really looking for some way of doing this in Windows Explorer without having to create another file. – ajb32x – 2014-04-30T14:13:06.327
0
Foggy memory here, but I believe there was a TweakUI addition to the Windows XP context menu for CMD and BAT files that allowed you to add your arguments and run the script. I believe this is what OP is looking for, and I would also find that very useful.
--tim
Are you limited to command line or launching from Explorer? Would a simple batch file or shortcut work? – CharlieRB – 2014-04-29T19:56:57.833