Wesmosis Posted June 20, 2005 Posted June 20, 2005 @MioKawaiithanx man.I'll try you advice then i'll try the one of Yzwol@Yzwolthanx......I'll give it a shot and tell ya what happened , O'right?
Jedi82 Posted June 20, 2005 Posted June 20, 2005 and if i just want to remove every shortcut created after some installasd?
Wesmosis Posted July 22, 2005 Posted July 22, 2005 unfortunately non of your commands work with meNeither:REG ADD %KEY%\050 /VE /D "Adding User Defined Shortcuts" /fREG ADD %KEY%\050 /V 1 /D "rundll32 setupapi,InstallHinfSection DefaultInstall 132 %CDROM%\Softwares\shortcuts.inf" /fNor:reg add %KEY%\050 /ve /d "Adding User Defined Shortcuts" /freg add %KEY%\050 /v 1 /d "%systemroot%\system32\rundll32.exe setupapi.dll,InstallHinfSection DefaultInstall 132 %CDROM%\Softwares\shortcuts.inf" /fI donno what's wrong?1
Yzöwl Posted July 24, 2005 Author Posted July 24, 2005 @ WesmosisIf you posted your entire cmd file, in an appropriate format, it may help, although my first guess is that you are lacking a 'set' statement for your CDROM variable.
Swe Posted July 27, 2005 Posted July 27, 2005 first of all thanks 10000000so i wont to install the file shortcuts.infby using Aprogram WPI not RunOnceEx.cmdwhat can i do?
Yzöwl Posted July 27, 2005 Author Posted July 27, 2005 (edited) Please read previous responses to Wesmosis for RunOnceEx.cmd syntax, and adjust accordingly for your preferred installation method. The command you need is the bit inside the quotes.<Edit>I find all methods beyond batch and inf files a waste of time, therefore I have never even attempted to look at their syntax and implemetation methods.However for my own curiosity, I took a 10 second glance at the Home Page and guess it'll be something like this['rundll32 setupapi,InstallHinfSection DefaultInstall 132 %CDROM%\\Softwares\\shortcuts.inf']</Edit> Edited July 27, 2005 by Yzöwl
MCP Posted November 19, 2008 Posted November 19, 2008 (edited) No waranty for any crashes or damages.Please be careful when you "play games" in your registry!Dear all,i know, this is a old topic.But i want to write my message here.Ok, for all who want to add shortcuts with inf script's, i have a working example here for you.It is a unattended script to install "poweroff 3.0.1.3" from Jorgen Bosman.This is my working code description for a Link.setup.ini, 001,,"""(LNK NAME)"",""""""(PATH TO FILE)"""" (PARAMETER)"","""""(ICON FILE)""""",(ICON INDEX),,""""""(START IN DIR)"""""",,""(LNK DESCRIPTION)"""setup.ini, 001,,"""Help"",""""""%11%\poweroff.exe"""" /?"","""""%11%\shell32.dll""""",23,,,,""Command line switches"""if you want to run the script form command prompt or .CMD/.BAT file you must go to the folder where the script islocated.i.e.:CD "D:\Documents and Settings\admin\Desktop""%SystemRoot%\System32\rundll32.exe" setupapi,InstallHinfSection DefaultInstall 132 .\poweroff.inf(This example is working on Windows XP Pro SP3 US)And here is the complete code with uninstall.[version]signature="$Windows NT$"AdvancedINF=2.5,%ADVPKPRMPT%[DefaultInstall]RequiredEngine=setupapiSmartReboot=ICheckAdminRights=1AddReg=InstallReg[DefaultUnInstall]RequiredEngine=setupapiSmartReboot=ICheckAdminRights=1AddReg=UnInstallReg[InstallReg]HKLM,"Software\Microsoft\Windows\CurrentVersion\RunOnce\setup","%SoftName%"HKLM,"Software\Microsoft\Windows\CurrentVersion\RunOnce\setup","Version: %VERSION%%REVISION%"HKLM,"Software\Microsoft\Windows\CurrentVersion\RunOnce\setup","____________________________"HKLM,"Software\Microsoft\Windows\CurrentVersion\RunOnce\setup","Install %SoftName% ...",0,"RunDll32.exe advpack.dll,LaunchINFSection %SoftFILE%, SoftInstall"[UnInstallReg]HKLM,"Software\Microsoft\Windows\CurrentVersion\RunOnce\setup","%SoftName%"HKLM,"Software\Microsoft\Windows\CurrentVersion\RunOnce\setup","Version: %VERSION%%REVISION%"HKLM,"Software\Microsoft\Windows\CurrentVersion\RunOnce\setup","____________________________"HKLM,"Software\Microsoft\Windows\CurrentVersion\RunOnce\setup","Remove %SoftName% ...",0,"RunDll32.exe advpack.dll,LaunchINFSection %SoftFILE%, SoftUnInstall"[SoftInstall]Copyfiles=INFFILE,Progra01AddReg=AddRegInstDelReg=DelRegInstUpdateInis=UpdateInisInst[SoftUnInstall]BeginPrompt=BeginPromptUnInstallEndPrompt=EndPromptUnInstallAddReg=AddRegRemoveDelReg=DelRegRemoveDelDirs=DelDirsRemoveDelfiles=INFFILE,Progra01UpdateInis=UpdateInisRemove[SourceDisksNames]1="%SoftName% %VERSION%%REVISION%","poweroff.cab",0[SourceDisksFiles]%SoftFILE%=1poweroff.exe=1[DestinationDirs]INFFILE=17Progra01=11[Progra01]poweroff.exe,,,2[INFFILE]%SoftFILE%,,,2[AddRegInst];Allow rename of protected files (i. e. NTLDR)HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager","AllowProtectedRenames",0x00010001,"0x00000001";HKLM,"Software\Microsoft\Windows\CurrentVersion\Uninstall\%SoftName% %VERSION%",,0x00000000,""HKLM,"Software\Microsoft\Windows\CurrentVersion\Uninstall\%SoftName% %VERSION%","DisplayIcon",,"%11%\poweroff.exe,0"HKLM,"Software\Microsoft\Windows\CurrentVersion\Uninstall\%SoftName% %VERSION%","DisplayName",,"%SoftName% %VERSION%%REVISION% (Remove only)";Section to create a Update Subfolder in "Add/Remove Programs";HKLM,"Software\Microsoft\Windows\CurrentVersion\Uninstall\%SoftName% %VERSION%","ParentDisplayName",,"%ParentDisplayName%";HKLM,"Software\Microsoft\Windows\CurrentVersion\Uninstall\%SoftName% %VERSION%","ParentKeyName",,"%ParentKeyName%"HKLM,"Software\Microsoft\Windows\CurrentVersion\Uninstall\%SoftName% %VERSION%","DisplayVersion",,"%VERSION%%REVISION%"HKLM,"Software\Microsoft\Windows\CurrentVersion\Uninstall\%SoftName% %VERSION%","Comments",,"%COMMENT%"HKLM,"Software\Microsoft\Windows\CurrentVersion\Uninstall\%SoftName% %VERSION%","UninstallString",,"rundll32.exe setupapi,InstallHinfSection DefaultUnInstall 132 %17%\%SoftFILE%";Add Registry key on installation here;[DelRegInst]HKCU,"Software\JoBo\Poweroff";HKCU,"Software\JoBo" ;(use it if you dont use any other JoBo software)[UpdateInisInst]setup.ini, progman.groups,,"001=%16407%\%SoftName%"setup.ini, 001,,"""%SoftName%"",""""""%11%\poweroff.exe"""""",,,,,,""%DESCRIPTION%"""setup.ini, 001,,"""Help"",""""""%11%\poweroff.exe"""" /?"","""""%11%\shell32.dll""""",23,,,,""Command line switches""";setup.ini, 001,,"""(LNK NAME)"",""""""(PATH TO FILE)"""" (PARAMETER)"","""""(ICON FILE)""""",(ICON INDEX),,""""""(START IN DIR)"""""",,""(LNK DESCRIPTION)""";Uninstallation[BeginPromptUnInstall]Prompt=%UNINSTASK% %SoftNAME% %VERSION%%REVISION%?ButtonType=YESNOTitle=Warning !!!!!![EndPromptUnInstall]Prompt=%SoftNAME% %UNINSTEND% [DelRegRemove]HKLM,"Software\Microsoft\Windows\CurrentVersion\Uninstall\%SoftName% %VERSION%"[AddRegRemove][DelDirsRemove][UpdateInisRemove]setup.ini, progman.groups,, "001=%16407%\%SoftName%"setup.ini, 001,,"""%SoftName%""setup.ini, 001,,"""Help""[Strings]SoftFILE="poweroff.INF"SoftName="Poweroff"VERSION="3.0.1.3"REVISION=""COMMENT="INF Script by 13/13"DESCRIPTION="Turn of computer local or remote"ParentDisplayName="Command line tools"ParentKeyName="CommandLineTools"UNINSTASK="Please check if you've removed all services from Poweroff! Do you want to uninstall"UNINSTEND="uninstallation is finished.ADVPKPRMPT = "Please install the new Advpack.dll Version 2.5 or above to run the installation!"[HELP];########## Help ;; REG_SZ = 0x00000000; REG_MULTI_SZ = 0x00010000; REG_EXPAND_SZ = 0x00020000; REG_BINARY = 0x00000001; REG_DWORD = 0x00010001; REG_SZ_APPEND = 0x00010008;; HKCR = HKEY_Classes_Root; HKCU = HKEY_Current_User; HKLM = HKEY_Local_Machine; HKU = HKEY_Users; HKCC = HKEY_Current_ConfigBest regards MCPpoweroff.inf Edited November 19, 2008 by MCP
mrquincy Posted March 31, 2009 Posted March 31, 2009 (edited) the AutoIT solutions I've seen seem like cop-out solutions and OptimumX's shortcut.exe just does not work. This INF solution seems to be the best to me...but I'm having no luck getting it to work.Here's my INF.[Version]Signature=$WINDOWS NT$[Shortcuts]UpdateInis=AddLink[AddLink]setup.ini, progman.groups,, "group1=""%16408%""setup.ini, group1,,"""bginfo"",""""""C:\bginfo.exe default.bgi /timer:0 /nolicprompt /silent"""""""setup.ini, progman.groups,, "group2=""%16409%""setup.ini, group2,,"""Windows Media Player"",""""""C:\Program Files\Windows Media Player\wmplayer.exe"""""""setup.ini, progman.groups,, "group3=""%16409%""setup.ini, group3,,"""Microsoft Word"",""""""C:\Program Files\Microsoft Office\Office12\winword.exe"""""""setup.ini, progman.groups,, "group4=""%16409%""setup.ini, group4,,"""Microsoft Powerpoint"",""""""C:\Program Files\Microsoft Office\Office12\powerpnt.exe"""""""setup.ini, progman.groups,, "group5=""%16409%""setup.ini, group5,,"""Microsoft Excel"",""""""C:\Program Files\Microsoft Office\Office12\excel.exe"""""""here are the lines I added to runonceex.cmd:REG ADD %KEY%\045 /VE /D "Adding user defined shortcuts" /fREG ADD %KEY%\045 /V 1 /D "rundll32 setupapi,InstallHinfSection Shortcuts 128 E:\shortcuts.inf" /fIt may be best practice not to hard code the E drive as the path to the inf...but for my computer setup it works fine. Does the INF support switches, as I've attempted with BGinfo?I bet this problem has something to do with setup.ini but I'm drawing a blank as to what my next step should be Edited March 31, 2009 by mrquincy
Yzöwl Posted March 31, 2009 Author Posted March 31, 2009 First of all you have an imbalance with your 'double-quotes' in your progman.groups lines.In your inf you could replace C:\ with %24%, and C:\Program Files with %16422%In order to not hard-code E: you would need to somehow programatically ascertain that letter first.
mrquincy Posted March 31, 2009 Posted March 31, 2009 Thanks for the quick reply, and good catch.I've been reviewing your inf code and the technet article http://technet.microsoft.com/en-us/library/dd361909.aspx.Your inf has significantly more nested quotations than the microsoft example (probably because yours has actually tested working ). What do I have to gain by maintaining the complexity of the quotations? I also noticed that the technet inf example has a series of three commas after the path to the target exe. What do these three commas represent in the inf syntax?
Yzöwl Posted March 31, 2009 Author Posted March 31, 2009 (edited) The original example used a few more double quotes than strictly necessary (in order to minimise problems with users using anything at all with spaces in the name).Here is an updated template, tested in Windows 2000, XP, VISTA and Windows 7[Version]Signature="$Windows NT$"[Shortcuts]UpdateInis=AddLink[AddLink];creates a new section in the ini file and defines its location;ini-name,section-name,oldsection-name,newsection-name=intendedlocationsetup.ini,progman.groups,,group4=%16386%\Standalone\Restoration;creates the link within the defined section of that ini file;ini-name, section-name, oldlink-name, "newlink-name, exe-name, icon-file-name, icon-index, profile, start-in-location"setup.ini,group4,,"Restoration,""""""%16422%\Standalone\Restoration\Restoration.exe"""""""The only double quotes required in my tests seemed to be those shown. The only differences were that in VISTA and Windows 7, if newlink-name includes spaces those spaces are replaced with underscores.Because VISTA onwards uses a different filing structure here are an updated list of DirID's;DirID's For Windows Vista Onwards [x86 & x64]1 = <Location of running inf>10 = %SystemRoot%11 = %SystemRoot%\system3212 = %SystemRoot%\system32\DRIVERS17 = %SystemRoot%\INF18 = %SystemRoot%\help20 = %SystemRoot%\fonts21 = %SystemRoot%\system32\viewers23 = %SystemRoot%\system32\spool\drivers\color24 = %SystemDrive%\25 = Shared directory30 = <Root directory of the boot disk>\50 = %SystemRoot%\SYSTEM51 = %SystemRoot%\system32\spool52 = %SystemRoot%\system32\spool\DRIVERS\W32X86 ;(x86 systems only)52 = %SystemRoot%\system32\spool\DRIVERS\x64 ;(x64 systems only)53 = %UserProfile%54 = <Directory where bootmgr.exe is located>\55 = %SystemRoot%\system32\spool\PRTPROCS\W32X86 ;(x86 systems only)55 = %SystemRoot%\system32\spool\PRTPROCS\x64 ;(x64 systems only)16384 = %UserProfile%\Desktop16386 = %UserProfile%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs16389 = %UserProfile%\Documents16390 = %UserProfile%\Favorites16391 = %UserProfile%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup16392 = %UserProfile%\AppData\Roaming\Microsoft\Windows\Recent16393 = %UserProfile%\AppData\Roaming\Microsoft\Windows\SendTo16395 = %UserProfile%\AppData\Roaming\Microsoft\Windows\Start Menu16397 = %UserProfile%\Music16398 = %UserProfile%\Videos16400 = %UserProfile%\Desktop16403 = %UserProfile%\AppData\Roaming\Microsoft\Windows\Network Shortcuts16404 = %SystemRoot%\Fonts16405 = %UserProfile%\AppData\Roaming\Microsoft\Windows\Templates16406 = %AllUsersProfile%\Microsoft\Windows\Start Menu16407 = %AllUsersProfile%\Microsoft\Windows\Start Menu\Programs16408 = %AllUsersProfile%\Microsoft\Windows\Start Menu\Programs\Startup16409 = %Public%\Desktop (%UserProfile%\..\Public\Desktop)16410 = %AppData%16411 = %AppData%\Microsoft\Windows\Printer Shortcuts16412 = %LocalAppData%16413 = %AppData%\Microsoft\Windows\Start Menu\Programs\Startup16414 = %AllUsersProfile%\Microsoft\Windows\Start Menu\Programs\Startup16415 = %UserProfile%\Favorites16416 = %LocalAppData%\Microsoft\Windows\Temporary Internet Files16417 = %AppData%\Microsoft\Windows\Cookies16418 = %LocalAppData%\Microsoft\Windows\History16419 = %ProgramData%16420 = %SystemRoot%16421 = %SystemRoot%\system3216422 = %ProgramFiles%16423 = %UserProfile%\Pictures16424 = %UserProfile%16425 = %SystemRoot%\SysWOW64 ;(x64 systems only)16426 = %ProgramFiles(x86)% ;(x64 systems only)16427 = %CommonProgramFiles%16428 = %CommonProgramFiles(x86)% ;(x64 systems only)16429 = %AllUsersProfile%\Microsoft\Windows\Templates16430 = %Public%\Documents (%UserProfile%\..\Public\Documents)16431 = %AllUsersProfile%\Microsoft\Windows\Start Menu\Programs\Administrative Tools16432 = %AppData%\Microsoft\Windows\Start Menu\Programs\Administrative Tools16437 = %Public%\Music (%UserProfile%\..\Public\Music)16438 = %Public%\Pictures (%UserProfile%\..\Public\Pictures)16439 = %Public%\Videos (%UserProfile%\..\Public\Videos)16440 = %SystemRoot%\resources16441 = %SystemRoot%\resources\040916442 = %AllUsersProfile%\OEM Links16443 = %LocalAppData%\Microsoft\Windows\Burn\Burn Edited May 11, 2009 by Yzöwl Post updated due to performed testing.
mrquincy Posted March 31, 2009 Posted March 31, 2009 I see I see. Specifically I was looking at your lines that look like this:setup.ini, group4,,"""Restoration"",""""""%16422%\Standalone\Restoration\Restoration.exe"""""""Specifically """"""%16422%\Standalone\Restoration\Restoration.exe"""""". Are the extra quotes to account for the spaces in %16422%?Could you explain the functionality of your runonce reg add commands? Particularly the %REG%\045 key and the significance of rundll32 setupapi,InstallHinfSection Shortcuts 128. Would I be correct to assume %REG%\045 is similar to the common DIRID listings? My imagination suggests that rundll32, setupapi,InstallHingSection are the necessary components to integrate the contents of shortcuts.inf to setup.ini. I'm at a loss for what the Shortcuts 128 portion of this reg add command does, could you explain this as well?Sorry, lots of questions...A.) Why so many quotes in """"""%16422%\Standalone\Restoration\Restoration.exe""""""?B.) Is %REG%\045 similar in function to common DIRID shortcuts?C.) How does rundll32 setupapi,InstallHinfSection Shortcuts 128 effect the reg add command? I understand that because this information follows /d it is the data portion of the key...but how does that help integrate shortcuts.inf into setup.ini?I still haven't successfully automated my desktop shortcuts using an INF...but with your help in understanding the foundation for this method I'm confident I can get this working the way you intended.
Yzöwl Posted April 1, 2009 Author Posted April 1, 2009 I have updated my previous post in order to help answer A.)I'm not sure what you mean in B.), (%REG%\045 doesn't exist), please clarify.For C.), that is the command-line which performs the install/invokation of the inf file.
Yzöwl Posted April 1, 2009 Author Posted April 1, 2009 For that I recommend you read 'The Guide'.Incidentally, because you are running a minimum of Windows XP sp2, (Office 2007 minimum requirement), here is an alternative inf method for creating your shortcuts.[Version]Signature = $Windows NT$[DefaultInstall]ProfileItems = AddBgi, AddWmv, AddDoc, AddPps, AddXls[AddBgi]Name = bginfo, 1CmdLine = 24, , bginfo.exe default.bgi /timer:0 /nolicprompt /silentSubDir = Startup[AddWmv]Name = Windows Media Player, 8, 16409CmdLine = 16422, Windows Media Player, wmplayer.exe[AddDoc]Name = Microsoft Word, 8, 16409CmdLine = 16422, Microsoft Office\Office12, winword.exe[AddPps]Name = Microsoft Powerpoint, 8, 16409CmdLine = 16422, Microsoft Office\Office12, powerpnt.exe[AddXls]Name = Microsoft Excel, 8, 16409CmdLine = 16422, Microsoft Office\Office12, excel.exe
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