Jump to content

Recommended Posts

Posted

Hi,

I cannot get the following batch command lines to work in GuiRunOnce. :no:

1. delete useless favorites shortcut and folder

2. Moving Userprofile Shortcut ...

3. registering and unregistering dll in c:\windows\system32

Please refer to the following and thanks.

winnt.sif

[GuiRunOnce]

%systemdrive%\install\batch.cmd

batch.cmd

rem .... delete useless favorites shortcut and folder

ATTRIB -R "%userprofile%\Favorites" /S /D

DEL /S /Q "%userprofile%\Favorites\*.url"

DEL /S /Q "%userprofile%\Favorites\Links\*.url"

ATTRIB +R "%userprofile%\Favorites" /S /D

ECHO.

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\system32

regsvr32/s wmpshell.dll

regsvr32 /s oleacc.dll

regsvr32 /s actxprxy.dll

regsvr32 /u /s zipfldr.dll


Posted (edited)

I have a long list of batch command and those lines i posted are not executed during

unattended installation.

When the computer first boot it did not do the following ...

1. delete useless favorites shortcut and folder of the current user

2. Moving Userprofile Shortcut ...

3. registering and unregistering the following dll in c:\windows\system32

regsvr32/s wmpshell.dll

regsvr32 /s oleacc.dll

regsvr32 /s actxprxy.dll

regsvr32 /u /s zipfldr.dll

Edited by illusions
Posted

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.

Posted

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

Posted

Try this...

[GuiRunOnce]

REG ADD HKCU\Software\Microsoft\Windows\CurrentVersion\Runonce /v finalcommands /d %SystemDrive%\install\batch.cmd

Posted

Also see if this batch file serves you any better.

@ECHO OFF
SETLOCAL
SET "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%\system32
FOR %%a IN (wmpshell oleacc actxprxy) DO REGSVR32 /S %%a.dll
REGSVR32 /U /S zipfldr.dll

Posted

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...