-1

I have this line:

C:\Windows\system32\cmd.exe start /minimized /wait cmd.exe /c picture.jpg

I use this line in Target field of shortcut.

When I run it, it opens minimized cmd, and picture. What I need is to close that cmd, after opening picture, or to run cmd in hidden mode.

Can anyone help? Thanks in advance.

Levon
  • 138,105
  • 33
  • 200
  • 191
user1437437
  • 1
  • 1
  • 1
  • 1

3 Answers3

1

I am not sure it this may work in your scenario. There are two possible workouts to this.

1) Use a batch script and in the last line, simply add exit to the script. save it as something.bat and run it whenever needed. This will execute the scripts and in the end, the cmd will exit.

2) Alternately you may use want to run the cmd in hidden mode (not minimized). to do this, create a batch job. then pack this batch file using this particular exe compressor - 'iExpress'. (type iexpress under the run box) This has an option to run the scripts in hidden mode. they will run in background.

BhaveshDiwan
  • 669
  • 10
  • 22
  • I can't use batch script. I have picture.jpg, and shortcut of it in the same directory, and need to place C:\Windows\system32\cmd.exe start /c picture.jpg in the Target field of shortcut. Whit this, when I click on shortcut it opens picture.jpg and cmd, but I need to open just a picture without cmd if possible. Can I combine exit command with my line, like this: C:\Windows\system32\cmd.exe start /minimized /wait cmd.exe /c picture.jpg & exit – user1437437 Jun 05 '12 at 13:39
  • then simply use iexpress for hidden cmd windows – BhaveshDiwan Jun 06 '12 at 13:19
0

Isn't

C:\Windows\System32\cmd.exe /c start picture.jpg

doing what you need ?

Why don't you just point the shortcut directly to

picture.jpg

?

franckspike
  • 2,039
  • 25
  • 18
  • I can't use batch script. I have picture.jpg, and shortcut of it in the same directory, and need to place C:\Windows\system32\cmd.exe start /c picture.jpg in the Target field of shortcut. Whit this, when I click on shortcut it opens picture.jpg and cmd, but I need to open just a picture without cmd if possible. Can I combine exit command with my line, like this: C:\Windows\system32\cmd.exe start /minimized /wait cmd.exe /c picture.jpg & exit – user1437437 Jun 05 '12 at 13:41
0

Why you need cmd to open a picture?

Just do it like

rundll "C:\Program Files\Windows Photo Viewer\PhotoViewer.dll" "image.png"
Kris
  • 8,680
  • 4
  • 39
  • 67
  • I can't use batch script. I have picture.jpg, and shortcut of it in the same directory, and need to place C:\Windows\system32\cmd.exe start /c picture.jpg in the Target field of shortcut. Whit this, when I click on shortcut it opens picture.jpg and cmd, but I need to open just a picture without cmd if possible. Can I combine exit command with my line, like this: C:\Windows\system32\cmd.exe start /minimized /wait cmd.exe /c picture.jpg & exit – user1437437 Jun 05 '12 at 13:44
  • The name rundll specified in the Target box is not valid. Make sure that path and file name is correct. – user1437437 Jun 05 '12 at 13:52
  • i dont think so. but why you need such a shortcut mechanism!!?? – Kris Jun 05 '12 at 13:53
  • depends on windows version, the file name might vary. it might be rundll32.exe, and you might need to give full path. – Kris Jun 05 '12 at 13:55