How To Execute Cmd.exe Silently?

I use below code in Run dialog of Windows XP.

cmd /c "C://Program Files/Adobe/Adobe Photoshop CS4/Photoshop.exe"

You may replace the program path any program installed on your system. The problem is Photoshop launches up but cmd.exe window still keeps. I do not want to cmd.exe file pop up. Is it possible to launch up a program via cmd without opening a cmd.exe window? I need cmd work silently. BTW, I need this code for a program. So I need to start the program via cmd but without cmd.exe window popping up.

Further Comments

Because I will use that code in a program. Program can initiate the cmd exe. But the problem is we do not know which version of Photoshop installed. So it can be Photoshop CS4 or Photoshop CS5. Normally when you type below code in Run you get the Photoshop no matter which is installed.

photoshop

So I want to initiate the Photoshop with this method. Program will initiate cmd as Run above but something like below:

cmd /c photoshop

But it does not work. And even the cmd window appears up. I want to make the process run silently. Also we should not install any other tool. I want a solution that will work on a default Windows.


Solution 1:

The problem is that the Command Prompt (cmd) cannot terminate - it is stuck up there on the screen waiting for Photoshop to terminate.

To launch Photoshop in a bat file and let the batch file continue on and terminate, use the start command, which starts a specified program or command in a separate window.

For example:

start "" "C:\Program Files\Adobe\Adobe Photoshop CS4\Photoshop.exe"

Solution 2:

HSTART http://www.ntwind.com/software/utilities/hstart.html

You can do

  • start ... run
  • c:\hstart\hstart.exe /NOCONSOLE "cmd /c "c:\program files\microsoft office\office11\winword.exe""

or create an icon.

Some use it to run bat files.. (others do so from a vbs which can also run it with cmd.exe and hide the command window)..but you can use hstart.

I do echo others though, in since you are running an EXE, if you do start..run..pathofexe or make an icon for it, a command prompt won't launch. So why do you want to start it from cmd.exe ?

Also, note.. in dos and windows you use backslashes in directory paths. Forward slashes are for URLs or directory paths in unix or linux.