Welcome to the DoItYourself Forums!

To post questions, help other DIYers and reduce advertising (like the one on your left), join our DIY community. It's free!

Shortcut execution speed


2000's Avatar
Member

Join Date: Dec 2000
Posts: 1,019

12-29-01, 03:30 PM   #1  
Shortcut execution speed

Given two shortcuts: LNK and URL, each executing the same batch file, why does Explorer execute the batch twice as fast through the URL shortcut? If you can enlighten me, please do!

Curious? The batch loads a HTML document & invokes a dialup connection via shortcuts on the Start Menu. The command lines are the same, except for shortcut syntax conventions.

 
Sponsored Links
2000's Avatar
Member

Join Date: Dec 2000
Posts: 1,019

12-31-01, 01:56 PM   #2  
self answered

A little research revels: LNK - Relative Path and URL - Absolute Path. Thus greater speed. Input conventions and file structures provide clews.

LNK
Command Line - FilePathSpec [optional parameters]
Start In - PathSpec [optional]
Shortcut key [optional]
Window size [default & optional]
(is resolved) - same for PIF

URL
URL=file:///FilePathSpec [must be parameterless]
(absolute)

Thats the synopsis.


Something that may be useful, spawning from: annoyance - Start, Click, Right Click ... to death.

MS solution: "Web view" & single click. Access from the drop down address bar, but adds Registry entries plus the infamous restart [web view].

Simpler: dummy HTML. <HTML><HEAD></HEAD><BODY></BODY></HTML>
Notepad >Save As >Desktop\"Setup.HTML" Include quotes, else Notepad adds TXT extension.

Increased usefulness: launch programs or Folders from Favorites. Any type of shortcut , LNK, PIF, URL, may be used. URL is the simplest to add & remove dynamically via batch or script.

For tinkering in Win98 or updating - possibles: Regedit, SystemInfo, Command.com, and %windir% Folder.
Tinkering online: possibles - Folders %windir%\Tempor~1, %windir%\Cookies, Index.dats [via Edit] or anything else you find useful.


Sample batch:

[code]

@Echo off

REM shorten cmd length - avoid quotes & 8.3 pathnames

Set Folder=%windir%\Favorites\
Set SysIn=C:\Program Files\Common Files\Microsoft Shared\MSINFO\MSINFO32.EXE

REM quotes for spaces in filenames

Echo [InternetShortcut]>%Folder%"Regedit Now.url"
Echo URL=file:///%windir%\REGEDIT.EXE>>%Folder%"Regedit Now.url"

Echo [InternetShortcut]>%Folder%"System Info Now.url"
Echo URL=file:///%SysIn%>>%Folder%"System Info Now.url"

Echo [InternetShortcut]>%Folder%"Command Now.url"
Echo URL=file:///%comspec%>>%Folder%"Command Now.url"

Echo [InternetShortcut]>%Folder%"Windows Folder.url"
Echo URL=file:///%windir%>>%Folder%"Windows Folder.url"

REM for fun - perverse use of URL - execute batch

REM Write batch - "Hello World" - "MS pun"

Echo @Echo.>%windir%\Command\hello.bat
Echo @Echo Hello World>>%windir%\Command\hello.bat
Echo @Echo.>>%windir%\Command\hello.bat
Echo @Echo Where do you want to go today?>>%windir%\Command\hello.bat

REM Favori~1 shortcut

Echo [InternetShortcut]>%Folder%"Hello World.url"
Echo URL=file:///%windir%\Command\hello.bat>>%Folder%"Hello World.url"

Set Folder=
Set SysIn=
Exit

[/code]

Batch is easily made recursive & is more portable than script.

Have a good year!
2000

 
Search this Thread