I need to launch a shortcut to a program (vlc.exe) and have it launch with certain attributes (it's quite a long string) and the target box will not accept enough characters. I need help finding another way to do so, I was wondering if you can launch a shortcut and attributes using a batch script? Or any other ideas?

To put it in context, I'm replacing my Firefox icon with a vlc shortcut to launch and record a 2 second snippet of who is using my computer when I'm away. The complete code I need is-

"C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" vlc dshow:// :dshow-vdev="Monitor Webcam" :dshow-adev="none" :dshow-size="640x480" :dshow-caching=1000 --run-time=2 -V dummy --intf=dummy --dummy-quiet :sout=#transcode{vcodec=h264,vb=800,scale=1,acodec=mpga,ab=128,channels=2,samplerate=44100}:file{dst=C:\records\test1.ts} :sout-keep

But the target box maxes at-

"C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" vlc dshow:// :dshow-vdev="Monitor Webcam" :dshow-adev="none" :dshow-size="640x480" :dshow-caching=1000 --run-time=2 -V dummy --intf=dummy --dummy-quiet :sout=#transcode{vcodec=h264,vb=800,scale=1,acodec=mpga,ab=12

  • "I was wondering if you can launch a shortcut and attributes using a batch script?" - Just launch VLC directly with required params from a batch file, and create a shortcut to the batch file with FF's name, icon etc.
    – Karan
    Commented Feb 2, 2013 at 20:04
  • Did you find a solution to do it directly? Commented Aug 30, 2019 at 21:27

2 Answers 2


There is a dozen ways to do this. IF I were you I would set the whole nasty string as a System variable. I will try to explain.

  1. Hold The "windows button" on the keyboard and press R (to open run window)
  2. Copy stuff inside quotes to the run window "rundll32 sysdm.cpl,EditEnvironmentVariables"
  3. Click on the bottom "new" button a small window "New System variable" will appear
  4. Pick A variable name say. I will use "WebCam" with out the quotes
  5. for the variable value i would put all the after the vlc.exe"
  6. click OK to both windows.
  7. For you short cut use "C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" %WebCam%
  8. Then test it, with any luck it will work. It should, it might.. Well who knows GLHF

enter image description here

  • Is there a direct solution? I have a program which somehow had the correct long Target (even though the windows dialog box Target field only showed some of it). However, when I modified it, I couldn't put in the old long value. Commented Aug 30, 2019 at 21:28

I'm not experienced with .bat files but I think your idea would work. I tried the following to play a playlist with windows media player:

start "C:\Program Files (x86)\Windows Media Player\wmplayer.exe" "C:\play.m3u"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .