Computing.Net > Forums > Programming > Open shortcut with batch file

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Open shortcut with batch file

Reply to Message Icon

Name: bobbbby
Date: March 4, 2008 at 10:08:45 Pacific
OS: xp
CPU/Ram: -
Product: -
Comment:

Ive made a shortcut to a .bat file and edited the properties of the shortcut to change the font, size and location of the window.

If i try to run the shortcut with another bat file my bat file opens in a normal window and all my lovely settings are gone. Is there a way to open my bat file with the shortcut settings?

START "" "C:\programX.lnk" doesnt work...



Sponsored Link
Ads by Google

Response Number 1
Name: klint
Date: March 6, 2008 at 07:53:10 Pacific
Reply:

rundll32 shell32.dll,ShellExec_RunDLL "C:\prog.lnk"


0

Response Number 2
Name: Sergy
Date: March 25, 2008 at 16:59:15 Pacific
Reply:

Hi Klint,

Didn't work for me
rundll32 shell32.dll,ShellExec_RunDLL "C:\prog.lnk" (I copied pasted it in the batch file)
Tried it with both batch file and a link called prog.lnk in in root C:\ and got the error msg saying: ""Windows cannot find "C:\prog.lnk" make sure you typed the name correctly...""
I have made some other basic batch files succesfully but I'm stuck with this one, am I missing smt here?

"Imagination is more important than knowledge..."

-Albert Einstein


0

Response Number 3
Name: Sergy
Date: March 25, 2008 at 17:27:25 Pacific
Reply:

Oh nevermind,
I got into the cmd and explore c:\ and found out that my "prog.lnk" (that I created with righ click>create a shortcut then typed www.google.com) its name was actually "prog.url"! so I just wrote in the batch file:

prog.url

And it opened the link to google in my Opera Browser!

Then I created a shortcut to Winamp (using the same method)and "dir" in cmd C: and found out that the shortcut was Winamp.lnk, (I should have known before, a shorcut to a program is always going to tave the extension ".lnk" while for a website a ".url".
So I went ahead and edit my batch file with:

winamp.lnk (both, batch file and winamp.lnk were in the c:\)

And it opened winamp!
then I tried with your solution:

rundll32 shell32.dll,ShellExec_RunDLL "C:\winamp.lnk"

And it worked as well!

Cheers!!!
PS: These tests were performed in WinXPPro

"Imagination is more important than knowledge..."

-Albert Einstein


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Open shortcut with batch file

Get last line with batch file www.computing.net/answers/programming/get-last-line-with-batch-file/17019.html

Help with Batch File www.computing.net/answers/programming/help-with-batch-file/14978.html

Help with batch file www.computing.net/answers/programming/help-with-batch-file/17088.html