MSFN Forum: shortcut.exe - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

shortcut.exe Rate Topic: -----

#1 User is offline   mark83 

  • Newbie
  • Group: Members
  • Posts: 11
  • Joined: 22-August 07

Posted 23 August 2007 - 02:21 PM

I have put shortcut.exe into $OEM$\$$\System32

Now I'm trying to make a shortcut calling a cmd files with this content

 
@echo off

rem set t=    FULL PATH TO EXE
rem set n=    FULL PATH TO LOCATIOON OF SHORTCUT
rem set d=    WORKING DIRECTORY OF SHORTCUT
rem set a=    ARGUMENTS OF SHORTCUT
rem set i=    ICONFILE 
rem set X=    ICONINDEX 
rem start /wait shortcut.exe -t %t% -n %n% -d %d% -a %a% -i %i% -X %x% -f

set 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% -f 



What seems to be the problem ?


#2 User is offline   IcemanND 

  • MSFN Junkie
  • Group: Super Moderator
  • Posts: 3,249
  • Joined: 24-September 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 23 August 2007 - 07:58 PM

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 off

rem set t= FULL PATH TO EXE
rem set n= FULL PATH TO LOCATIOON OF SHORTCUT
rem set d= WORKING DIRECTORY OF SHORTCUT
rem set a= ARGUMENTS OF SHORTCUT
rem set i= ICONFILE
rem set X= ICONINDEX
rem start "" /wait shortcut.exe -t "%t%" -n "%n%" -d "%d%" -a "%a%" -i "%i%" -X "%x%" -f

set 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%" -f


If that doesn't work try removing the quotes from the switches after the shortcut.exe command and try it.

#3 User is offline   os2fan2 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 400
  • Joined: 09-September 04

Posted 24 August 2007 - 01:25 AM

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 install

set HDOC=%UserProfile%\Personal
cd /d %allusersprofile%\Start Menu\Programs\Accessories
md Windows
cd Windows

:: nt351 cardfile
set HEXE=%SystemRoot%\System32\cardfile.exe
"shortcut.exe" -t %HEXE% -n CardFile -i %HEXE% -x 0 -f
set HEXE=%%SystemRoot%%\System32\cardfile.exe
set HKEY=HKCR\cardfile
reg add HKCR\.crd /ve /t reg_sz /d cardfile /f
reg add %HKEY%\DefaultIcon /ve /t reg_expand_sz /d "%HEXE%,0" /f
reg add %HKEY%\Shell\Open\Command /ve /t reg_expand_sz /d "%HEXE% %%1" /f
reg add %HKEY%\Shell\Print\Command /ve /t reg_expand_sz /d "%HEXE% /p %%1" /f

:: nt351 pifedit
set HEXE=%SystemRoot%\System32\pifedit.exe
"shortcut.exe" -t %HEXE% -n PifEdit -i %HEXE% -x 0 -f

:: topdesk from nt4 reskit
set HEXE=%SystemRoot%\system32\topdesk.exe
"shortcut.exe" -t %HEXE% -n TopDesk -i %HEXE% -x 0 -f

set HEXE=%SystemRoot%\System32\wincmd.exe
"shortcut.exe" -t %HEXE% -n "WinCmd" -i %HEXE% -x 0 -f

:L write from NT351
set HEXE=%SystemRoot%\System32\write2.exe
"shortcut.exe" -t %HEXE% -n Write -i %HEXE% -x 0 -f
set HEXE=%%SystemRoot%%\System32\write2.exe
set HKEY=HKCR\writefile
reg add HKCR\.wri /ve /t reg_sz /d writefile /f
reg add %HKEY%\DefaultIcon /ve /t reg_expand_sz /d "%HEXE%,0" /f
reg add %HKEY%\Shell\Open\Command /ve /t reg_expand_sz /d "%HEXE% %%1" /f
reg add %HKEY%\Shell\Print\Command /ve /t reg_expand_sz /d "%HEXE% /p %%1" /f

:: pbrush from 351
set HEXE=%SystemRoot%\System32\pbrush.exe
"shortcut.exe" -t %HEXE% -n "Paint Brush" -i %HEXE% -x 0 -f

:: winfile from 400
set HEXE=%SystemRoot%\System32\winfile.exe
"shortcut.exe" -t %HEXE% -n "File Manager" -i %HEXE% -x 0 -f

:: metapad
set HEXE=%SystemRoot%\System32\metapad.exe
"shortcut.exe" -t %HEXE% -n "Metapad" -i %HEXE% -x 0 -f
set HEXE=%%SystemRoot%%\System32\metapad.exe
set HKEY=HKCR\txtfile\shell\metapad\command
reg add %HKEY% /ve /t reg_expand_sz /d "%HEXE ""%1""" /f
cd ..\Games

:: mshearts from 510/Pro
set HEXE=%SystemRoot%\System32\mshearts.exe
"shortcut.exe" -t %HEXE% -n "Hearts" -i %HEXE% -x 0 -f

:: spider from Win98
set HEXE=%SystemRoot%\System32\spider.exe
"shortcut.exe" -t %HEXE% -n "Spider" -i %HEXE% -x 0 -f

:: 
cd ..\System Tools
set HEXE=%SystemRoot%\System32\changewp.exe
"shortcut.exe" -t %HEXE% -n "Change WP" -i %HEXE% -x 0 -f

:: hacked write.exe to load diskmgmt.msc
set 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 -f

set HEXE=%SystemRoot%\win3\quickresnt.exe
"shortcut.exe" -t %HEXE% -n "QuickRes NT" -i %HEXE% -x 0 -f

set HEXE=%SystemRoot%\win3\keyfinder.exe
"shortcut.exe" -t %HEXE% -n "Keyfinder" -i %HEXE% -x 0 -f

:: wininfo from savilltech.com
set HEXE=%SystemRoot%\win3\wininfo.exe
"shortcut.exe" -t %HEXE% -n "WinInfo" -i %HEXE% -x 0 -f

cd ..\Internet

set HEXE=%SystemRoot%\win3\genuinecheck.exe
"shortcut.exe" -t %HEXE% -n "Genuine Check" -i %HEXE% -x 0 -f

:: lister from www.ghisler.com
cd %userprofile%\Sendto
set HEXE=%SystemRoot%\System32\lister.exe
"shortcut.exe" -t %HEXE% -n "Lister" -i %HEXE% -x 0 -f

set 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 -f
set hkey=shell\ipfview
set hexe=%%systemroot%%\System32\iview.exe
reg 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.com
del %SystemRoot%\System32\edit.hlp

set HDOC=
set HEXE=
set HKEY=
set HEXY=

This post has been edited by os2fan2: 24 August 2007 - 01:28 AM


Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy