Windows 7 – Shortcut – Target Attributes too long

batchshortcutsvlc-media-playerwindows 7

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="640×480" :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="640×480" :dshow-caching=1000 –run-time=2 -V dummy –intf=dummy –dummy-quiet :sout=#transcode{vcodec=h264,vb=800,scale=1,acodec=mpga,ab=12

Best Answer

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