Run program with parameters windows

Run Software With Parameters In Windows

You need to either use the command line, run box or a program shortcut if you want to run a software program with parameters in Windows. All of these options are not very user friendly and can intimidate inexperienced users. Run With Parameters is an Open Source software program for the Windows operating system that provides another option that is suitable for users of all experience levels.

The computer program has to be installed on the system. It integrates itself into the right-click context menu of executable file extensions such as exe, bat and cmd with the option to add custom file extension during installation.

The advanced run box becomes available after right-clicking a supported file type and selecting run with parameters from the context menu. It is then possible to supply command line arguments to run the software with these additional parameters.

The computer program will remember command line arguments that have been used in the past for that specific software program. This option is also configured during installation. Up to 20 arguments are saved by default. The program will only use system resources during execution. The main application will terminate its process after the selected program has been started with the command line arguments. Run With Parameters is therefor a lightweight software program ideal for launching executables that require parameters from time to time (for example Google Chrome with or without extensions, Firefox with another profile). It can be downloaded from the developer’s homepage.

How do you run external programs with parameters without the cmd window showing up in Windows?

I just asked a question earlier today because I wanted to run an executable file that takes parameters from my C++ code and it wasn’t working.

It works now, but I’m still having problems since I thought I was going the right way about this, but it seems like what I want to accomplish can’t be done the way I’m approaching it.

This is my corrected code from my other question:

which is me running «pdftotext -layout myfile.pdf» as if I was running it from a CMD window.

The thing is, I don’t actually want the cmd to show up since I have a GUI interface on top of it and I want to display a nicer progress bar instead of seeing the windows pop-up for every file I need to parse.

Читайте также:  Загрузка процессора по ядрам linux

I looked around and either I don’t understand what I’m reading since I’m relatively new to C++, or I just didn’t find what I was looking for. I found that using CreateProcess, I should be able to do this, but after copying some code I found somewhere else, the cmd window pops-up anyway.

I’d like it if someone could give me the name of a function I could use to accomplish something like this or if someone could give some example code for this small case in the code I posted since I’m not sure I understand everything as I should, being new to C++ and all.

Edit: As requested in a comment, the code for CreateProcess that I tried is what I found at this url:

Which is (with my own parameters that I think should go there):

I’m a little bit overwhelmed since it uses some things I’ve never used before, but I think I understand the core (keyword: think). It doesn’t solve my problem, though, because the cmd shows up and by retesting it I actually noticed that the cmd doesn’t even run the .exe and doesn’t give me an error message.

I hope this bit of code helps. I didn’t want to look into it further since it seemed like I wasn’t even going in the right direction.

How to run an EXE file in PowerShell with parameters with spaces and quotes

How do you run the following command in PowerShell?

C:\Program Files\IIS\Microsoft Web Deploy\msdeploy.exe -verb:sync -source:dbfullsql=»Data Source=mysource;Integrated Security=false;User -dest:dbfullsql=»Data Source=.\mydestsource;Integrated Security=false;User >

19 Answers 19

When PowerShell sees a command starting with a string it just evaluates the string, that is, it typically echos it to the screen, for example:

If you want PowerShell to interpret the string as a command name then use the call operator (&) like so:

After that you probably only need to quote parameter/argument pairs that contain spaces and/or quotation chars. When you invoke an EXE file like this with complex command line arguments it is usually very helpful to have a tool that will show you how PowerShell sends the arguments to the EXE file. The PowerShell Community Extensions has such a tool. It is called echoargs. You just replace the EXE file with echoargs — leaving all the arguments in place, and it will show you how the EXE file will receive the arguments, for example:

Using echoargs you can experiment until you get it right, for example:

It turns out I was trying too hard before to maintain the double quotes around the connection string. Apparently that isn’t necessary because even cmd.exe will strip those out.

BTW, hats off to the PowerShell team. They were quite helpful in showing me the specific incantation of single & double quotes to get the desired result — if you needed to keep the internal double quotes in place. 🙂 They also realize this is an area of pain, but they are driven by the number of folks are affected by a particular issue. If this is an area of pain for you, then please vote up this PowerShell bug submission.

Читайте также:  Windows 10 как отключить установку дополнительных компонентов

For more information on how PowerShell parses, check out my Effective PowerShell blog series — specifically item 10 — «Understanding PowerShell Parsing Modes»

UPDATE 4/4/2012: This situation gets much easier to handle in PowerShell V3. See this blog post for details.

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

I need a batch file which will do the following:

How can I do this?

I tried this but with no luck:

Update

I’ve used the solution provided by Ganesh (below) and came up with this:

I’ve tested it on a local machine (changing the directories) but on the server (with the directory above) it does not work.

The folder directory with batch file:

The error

3 Answers 3

in batch file abc.bat

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

For the command you say you want to execute, do:

Hope this helps

Help on commands start and cd is output by executing in a command prompt window help start or start /? and help cd or cd /? .

But I do not understand why you need a batch file at all for starting the application with the additional parameter. Create a shortcut (*.lnk) on your desktop for this application. Then right click on the shortcut, left click on Properties and append after a space character «%USERPROFILE%\Desktop\BGInfo\dc_bginfo.bgi» as parameter.

Found another solution for the same. It will be more helpful.

START C:\»Program Files (x86)»\Test\»Test Automation»\finger.exe ConfigFile=»C:\Users\PCName\Desktop\Automation\Documents\Validation_ZoneWise_Default.finger.Config»

finger.exe is a parent program that is calling config solution. Note: if your path folder name consists of spaces, then do not forget to add «».

Not the answer you’re looking for? Browse other questions tagged batch-file cmd or ask your own question.

Linked

Hot Network Questions

Subscribe to RSS

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

site design / logo © 2021 Stack Exchange Inc; user contributions licensed under cc by-sa. rev 2021.4.16.39093

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.

Using the “start” command with parameters passed to the started program

I have a Virtual Machine in Virtual PC 2007.

To start it from the desktop, I have the following command in a batch file:

Читайте также:  Homm3 mac os big sur

But that leaves a dos prompt on the host machine until the virtual machine shuts down, and I exit out of the Virtual PC console. That’s annoying.

So I changed my command to use the START command, instead:

But it chokes on the parameters passed into Virtual PC.

START /? indicates that parameters do indeed go in that location. Has anyone used START to launch a program with multiple command-line arguments?

12 Answers 12

START has a peculiarity involving double quotes around the first parameter. If the first parameter has double quotes it uses that as the optional TITLE for the new window.

I believe what you want is:

In other words, give it an empty title before the name of the program to fake it out.

Instead of a batch file, you can create a shortcut on the desktop.

Set the target to:

and you’re all set. Since you’re not starting up a command prompt to launch it, there will be no DOS Box.

The spaces are DOSs/CMDs Problems so you should go to the Path via:

and then simply start VPC via:

1 means the first exe with «Virtual» at the beginning. So if there is a «Virtual PC.exe» and a «Virtual PC1.exe» the first would be the Virtual

1.exe and the second Virtual

Or use a VNC-Client like VirtualBox.

You can use quotes by using the [ /D»Path» ] use /D only for specifying the path and not the path+program. It appears that all code on the same line that follows goes back to normal meaning you don’t need to separate path and file.

will start IE with default web page.

starts with Bing, but does not reset your home page.

/D stands for «directory» and using quotes is OK!

WRONG EXAMPLE:

/D must only be followed by a directory path. Then space and the batchfile or program you wish to start/run

Tested and works under XP but windows Vista/7/8 may need some adjustments to UAC.

None of these answers worked for me.

Instead, I had to use the Call command:

I’m not sure this actually waits for completion. the C++ Redistributable I was installing went fast enough that it didn’t matter

The answer in «peculiarity» is correct and directly answers the question. As TimF answered, since the first parameter is in quotes, it is treated as a window title.

Also note that the Virtual PC options are being treated as options to the ‘start’ command itself, and are not valid for ‘start’. This is true for all versions of Windows that have the ‘start’ command.

This problem with ‘start’ treating the quoted parameter as a title is even more annoying that just the posted problem. If you run this:

Оцените статью