illusions Posted October 6, 2009 Share Posted October 6, 2009 Hi, I cannot get the following batch command lines to work in GuiRunOnce. 1. delete useless favorites shortcut and folder2. Moving Userprofile Shortcut ...3. registering and unregistering dll in c:\windows\system32Please refer to the following and thanks.winnt.sif[GuiRunOnce] %systemdrive%\install\batch.cmdbatch.cmdrem .... delete useless favorites shortcut and folderATTRIB -R "%userprofile%\Favorites" /S /DDEL /S /Q "%userprofile%\Favorites\*.url"DEL /S /Q "%userprofile%\Favorites\Links\*.url"ATTRIB +R "%userprofile%\Favorites" /S /DECHO.ECHO Moving Userprofile Shortcut ...attrib -r "%userprofile%\Start Menu\Programs" attrib -r "%userprofile%\Start Menu\Programs\Accessories" attrib -r -h "%userprofile%\Application Data" attrib -s "%userprofile%\Application Data\Microsoft" attrib -r "%userprofile%\Application Data\Microsoft\Internet Explorer\Quick Launch" move "%userprofile%\Start Menu\Programs\Internet Explorer.lnk" "%userprofile%\Start Menu\Programs\Accessories\Internet Explorer.lnk" move "%userprofile%\Start Menu\Programs\Outlook Express.lnk" "%userprofile%\Start Menu\Programs\Accessories\Outlook Express.lnk" move "%userprofile%\Start Menu\Programs\Remote Assistance.lnk" "%systemdrive%\Documents and Settings\All Users\Start Menu\Programs\Accessories\Remote Assistance.lnk" move "%userprofile%\Start Menu\Programs\Windows Media Player.lnk" "%userprofile%\Start Menu\Programs\Accessories\Windows Media Player.lnk" copy "%userprofile%\Start Menu\Programs\Accessories\Windows Media Player.lnk" "%userprofile%\Application Data\Microsoft\Internet Explorer\Quick Launch\Windows Media Player.lnk"attrib +r "%userprofile%\Start Menu\Programs" attrib +r "%userprofile%\Start Menu\Programs\Accessories" attrib +r +h "%userprofile%\Application Data" attrib +s "%userprofile%\Application Data\Microsoft" attrib +r "%userprofile%\Application Data\Microsoft\Internet Explorer\Quick Launch" rem .... registering and unregistering dll in c:\windows\system32regsvr32/s wmpshell.dllregsvr32 /s oleacc.dllregsvr32 /s actxprxy.dllregsvr32 /u /s zipfldr.dll Link to comment Share on other sites More sharing options...
g-force Posted October 8, 2009 Share Posted October 8, 2009 Is your "batch.cmd" not working or isn`t it executed? Link to comment Share on other sites More sharing options...
illusions Posted October 8, 2009 Author Share Posted October 8, 2009 (edited) I have a long list of batch command and those lines i posted are not executed duringunattended installation.When the computer first boot it did not do the following ...1. delete useless favorites shortcut and folder of the current user2. Moving Userprofile Shortcut ...3. registering and unregistering the following dll in c:\windows\system32regsvr32/s wmpshell.dllregsvr32 /s oleacc.dllregsvr32 /s actxprxy.dllregsvr32 /u /s zipfldr.dll Edited October 8, 2009 by illusions Link to comment Share on other sites More sharing options...
g-force Posted October 8, 2009 Share Posted October 8, 2009 Is the batch working if you execute it on a running system (logged on)? Link to comment Share on other sites More sharing options...
Guest Posted October 8, 2009 Share Posted October 8, 2009 Are we sure %userprofile% is there when GuiRunOnce runs? It's one of the last things created. If it's not there you can do a HKCU runonce to call the batch file later on in the process. Link to comment Share on other sites More sharing options...
illusions Posted October 8, 2009 Author Share Posted October 8, 2009 Hi g-force,Yes those listed batch line will work after computer reboot again and when i manually execute them.Hi -X- ,I guess %userprofile% is not setup yet that is why those lines are not executed.Please advice how to do a HKCU runonce to call the batch file later after reboot.Thanks Link to comment Share on other sites More sharing options...
Guest Posted October 8, 2009 Share Posted October 8, 2009 Try this...[GuiRunOnce]REG ADD HKCU\Software\Microsoft\Windows\CurrentVersion\Runonce /v finalcommands /d %SystemDrive%\install\batch.cmd Link to comment Share on other sites More sharing options...
Yzöwl Posted October 8, 2009 Share Posted October 8, 2009 Also see if this batch file serves you any better.@ECHO OFFSETLOCALSET "SMP=Start Menu\Programs"SET "WMP=Windows Media Player"SET "IE=Internet Explorer"PUSHD %UserProfile%\%SMP%DEL /F /S /Q /A "%UserProfile%\Favorites\*.url"FOR %%a IN ("%IE%" "Outlook Express" "%WMP%") DO ( IF EXIST "%%~a.lnk" MOVE "%%~a.lnk" Accessories)MOVE "Remote Assistance.lnk" "%AllUsersProfile%\%SMP%\Accessories"COPY "Accessories\%WMP%.lnk" "%AppData%\Microsoft\%IE%\Quick Launch"PUSHD %SystemRoot%\system32FOR %%a IN (wmpshell oleacc actxprxy) DO REGSVR32 /S %%a.dllREGSVR32 /U /S zipfldr.dll Link to comment Share on other sites More sharing options...
Noise Posted October 8, 2009 Share Posted October 8, 2009 If you want to keep the default Internet Explorer shortcuts from being created, a better way is to add the following to your WINNT.SIF file:[Branding] BrandIEUsingUnattended=Yes[URL] Home_Page=http://www.google.com/ AutoConfig=0 Link to comment Share on other sites More sharing options...
illusions Posted October 8, 2009 Author Share Posted October 8, 2009 (edited) Thank you all for your suggestion. As suggested using Runonce method works!I followed the example script in this thread .http://www.msfn.org/board/runonce-all-user...pid-431303.htmlAlso special thanks to Yzöwl for writing a more concise batch command for me. Edited October 8, 2009 by illusions 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