mark83 Posted August 23, 2007 Share Posted August 23, 2007 I have put shortcut.exe into $OEM$\$$\System32Now I'm trying to make a shortcut calling a cmd files with this content@echo offrem set t= FULL PATH TO EXErem set n= FULL PATH TO LOCATIOON OF SHORTCUTrem set d= WORKING DIRECTORY OF SHORTCUTrem set a= ARGUMENTS OF SHORTCUTrem set i= ICONFILE rem set X= ICONINDEX rem start /wait shortcut.exe -t %t% -n %n% -d %d% -a %a% -i %i% -X %x% -fset t="%ProgramFiles%\irfanview\i_view32.exe"set n="%ALLUSERSPROFILE%\Menuen Start\IrfanView.lnk"set d="%ProgramFiles%\irfanview"start /wait shortcut.exe -t %t% -n %n% -d %d% -fWhat seems to be the problem ? Link to comment Share on other sites More sharing options...
IcemanND Posted August 24, 2007 Share Posted August 24, 2007 try this, could be that the switch values need to be in quotes if they contain spaces, or that the START command is interpreting part of you command as the title.@echo offrem set t= FULL PATH TO EXErem set n= FULL PATH TO LOCATIOON OF SHORTCUTrem set d= WORKING DIRECTORY OF SHORTCUTrem set a= ARGUMENTS OF SHORTCUTrem set i= ICONFILErem set X= ICONINDEXrem start "" /wait shortcut.exe -t "%t%" -n "%n%" -d "%d%" -a "%a%" -i "%i%" -X "%x%" -fset t="%ProgramFiles%\irfanview\i_view32.exe"set n="%ALLUSERSPROFILE%\Menuen Start\IrfanView.lnk"set d="%ProgramFiles%\irfanview"start "" /wait shortcut.exe -t "%t%" -n "%n%" -d "%d%" -fIf that doesn't work try removing the quotes from the switches after the shortcut.exe command and try it. Link to comment Share on other sites More sharing options...
os2fan2 Posted August 24, 2007 Share Posted August 24, 2007 (edited) I change to the directory required, but i still have not fathomed out how to do this generically.This code runs at the time default-user is set, so %UserProfile%=\users\default\The batch both registers icons and registry settings as required for different apps. Shortcut is in quotes, because 4nt and tcmd have a shortcut with entirely different params, this disables the internal command and runs shortcut.exe.Programs required to run batches etc are installed via base install (ie dosnet/txtsetup), because these need to be there when the script runs. @echo off::~ Batch for setting desktop up at installset HDOC=%UserProfile%\Personalcd /d %allusersprofile%\Start Menu\Programs\Accessoriesmd Windowscd Windows:: nt351 cardfileset HEXE=%SystemRoot%\System32\cardfile.exe"shortcut.exe" -t %HEXE% -n CardFile -i %HEXE% -x 0 -fset HEXE=%%SystemRoot%%\System32\cardfile.exeset HKEY=HKCR\cardfilereg add HKCR\.crd /ve /t reg_sz /d cardfile /freg add %HKEY%\DefaultIcon /ve /t reg_expand_sz /d "%HEXE%,0" /freg add %HKEY%\Shell\Open\Command /ve /t reg_expand_sz /d "%HEXE% %%1" /freg add %HKEY%\Shell\Print\Command /ve /t reg_expand_sz /d "%HEXE% /p %%1" /f:: nt351 pifeditset HEXE=%SystemRoot%\System32\pifedit.exe"shortcut.exe" -t %HEXE% -n PifEdit -i %HEXE% -x 0 -f:: topdesk from nt4 reskitset HEXE=%SystemRoot%\system32\topdesk.exe"shortcut.exe" -t %HEXE% -n TopDesk -i %HEXE% -x 0 -fset HEXE=%SystemRoot%\System32\wincmd.exe"shortcut.exe" -t %HEXE% -n "WinCmd" -i %HEXE% -x 0 -f:L write from NT351set HEXE=%SystemRoot%\System32\write2.exe"shortcut.exe" -t %HEXE% -n Write -i %HEXE% -x 0 -fset HEXE=%%SystemRoot%%\System32\write2.exeset HKEY=HKCR\writefilereg add HKCR\.wri /ve /t reg_sz /d writefile /freg add %HKEY%\DefaultIcon /ve /t reg_expand_sz /d "%HEXE%,0" /freg add %HKEY%\Shell\Open\Command /ve /t reg_expand_sz /d "%HEXE% %%1" /freg add %HKEY%\Shell\Print\Command /ve /t reg_expand_sz /d "%HEXE% /p %%1" /f:: pbrush from 351set HEXE=%SystemRoot%\System32\pbrush.exe"shortcut.exe" -t %HEXE% -n "Paint Brush" -i %HEXE% -x 0 -f:: winfile from 400set HEXE=%SystemRoot%\System32\winfile.exe"shortcut.exe" -t %HEXE% -n "File Manager" -i %HEXE% -x 0 -f:: metapadset HEXE=%SystemRoot%\System32\metapad.exe"shortcut.exe" -t %HEXE% -n "Metapad" -i %HEXE% -x 0 -fset HEXE=%%SystemRoot%%\System32\metapad.exeset HKEY=HKCR\txtfile\shell\metapad\commandreg add %HKEY% /ve /t reg_expand_sz /d "%HEXE ""%1""" /fcd ..\Games:: mshearts from 510/Proset HEXE=%SystemRoot%\System32\mshearts.exe"shortcut.exe" -t %HEXE% -n "Hearts" -i %HEXE% -x 0 -f:: spider from Win98set HEXE=%SystemRoot%\System32\spider.exe"shortcut.exe" -t %HEXE% -n "Spider" -i %HEXE% -x 0 -f:: cd ..\System Toolsset HEXE=%SystemRoot%\System32\changewp.exe"shortcut.exe" -t %HEXE% -n "Change WP" -i %HEXE% -x 0 -f:: hacked write.exe to load diskmgmt.mscset HEXE=%SystemRoot%\System32\windisk.exe"shortcut.exe" -t %HEXE% -n "WinDisk" -i %HEXE% -x 0 -f:: set HEXE=%SystemRoot%\win3\usbview.exe"shortcut.exe" -t %HEXE% -n "UsbView" -i %HEXE% -x 0 -fset HEXE=%SystemRoot%\win3\quickresnt.exe"shortcut.exe" -t %HEXE% -n "QuickRes NT" -i %HEXE% -x 0 -fset HEXE=%SystemRoot%\win3\keyfinder.exe"shortcut.exe" -t %HEXE% -n "Keyfinder" -i %HEXE% -x 0 -f:: wininfo from savilltech.comset HEXE=%SystemRoot%\win3\wininfo.exe"shortcut.exe" -t %HEXE% -n "WinInfo" -i %HEXE% -x 0 -fcd ..\Internetset HEXE=%SystemRoot%\win3\genuinecheck.exe"shortcut.exe" -t %HEXE% -n "Genuine Check" -i %HEXE% -x 0 -f:: lister from www.ghisler.comcd %userprofile%\Sendtoset HEXE=%SystemRoot%\System32\lister.exe"shortcut.exe" -t %HEXE% -n "Lister" -i %HEXE% -x 0 -fset HEXE=%SystemRoot%\System32\metapad.exe"shortcut.exe" -t %HEXE% -n "Metapad" -i %HEXE% -x 0 -f:: iview opens OS/2 help files.set HEXE=%systemroot%\System32\iview.exe"shortcut.exe" -t %HEXE% -n "IPF Viewer" -i %HEXE% -x 0 -fset hkey=shell\ipfviewset hexe=%%systemroot%%\System32\iview.exereg add hkcr\inffile\%HKEY% /ve /t reg_sz /d "&IPF Viewer"reg add hkcr\inffile\%HKEY%\command /ve /t reg_expand_sz /f /d "%hexe% %%1"reg add hkcr\hlpfile\%HKEY% /ve /t reg_sz /d "&IPF Viewer"reg add hkcr\hlpfile\%HKEY%\command /ve /t reg_expand_sz /f /d "%hexe% %%1":: we copy msed.com and msed.ohp in $OEM$. Edit is something else again!del %SystemRoot%\System32\edit.comdel %SystemRoot%\System32\edit.hlpset HDOC=set HEXE=set HKEY=set HEXY= Edited August 24, 2007 by os2fan2 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now