View Single Post
Old 20 April 2007, 18:03   #251
thor
Registered User
thor's Avatar
 
Join Date: Mar 2006
Location: Germany
Posts: 898
I made a batch file (based on the CD_DVD.cmd one) that gets the desktop path from the registry, so it should work on all language versions.

Code:
@ECHO OFF
SETLOCAL
SET DESKTOPPATH=
SET Temp1=%Temp%.\%~n0%Random%1.reg
SET Temp2=%Temp%.\%~n0%Random%2.reg
START /WAIT REGEDIT /E %Temp1% "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders"
TYPE %Temp1% > %Temp2%
TYPE %Temp2% | FIND "Common Desktop" > %Temp1%
FOR /F "tokens=2 delims==" %%A IN (%Temp1%) DO CALL :ParseW2K %%A
SET DESKTOPPATH > NUL
DEL %Temp1%
DEL %Temp2%
ENDLOCAL & SET DESKTOPPATH=%DESKTOPPATH%
GOTO:EOF

:ParseW2K
IF DEFINED DESKTOPPATH (SET DESKTOPPATH=%DESKTOPPATH%) ELSE (SET DESKTOPPATH=%~f1)
GOTO:EOF
Then you can use i.e.
Code:
"%DESKTOPPATH%\SNES Emulator.lnk"
instead of
Code:
"C:\Documents and Settings\All Users\Desktop\SNES Emulator.lnk"
in your setup.cmd file.
thor is offline  
 
Page generated in 0.04783 seconds with 9 queries