Jump to content

RunOnceEx > Why can't i delete IE Favorites ?


Recommended Posts

Could someone please help me out with the following question, please :)

I use RunOnceEx and run 8 7z SFX installers + 'cleanup.cmd'. My problem is that in 'cleanup.cmd', then some things works fine, but then some dosen't work at all :

del "C:\Documents and Settings\Martin Hertz\Favorites\*.url"
rd /s /q "C:\Documents and Settings\Martin Hertz\Favorites\Links"

I am also adding the reg key needed for stopping the 'Links' folder getting recreated. Also, i don't bother using path variables and am using fixed paths since i'm the only person that's going to use the discs i make anyway, and also since i always reformat and install on 'C:\' and use 'D:\' for all my data and backups.

All other commands i have in 'cleanup.cmd' are executed just fine, like various 'copy', 'del' and 'rd' commands, but for same strange reason then the above code isn't ? Btw, i'm using Windows XP Pro. SP2 Corp. and am using nLite to integrate Xables XUDPack, make the CD unattended and add tweaks, and then i add some 7z SFX installers and a reg file for the tweaks that nLite dosen't support and which i also need.

Thank's in advance.

Edited by Martin H
Link to comment
Share on other sites


If you are using the classic IE 6, place the following in WINNT.SIF:

[Branding]
BrandIeUsingUnattended = Yes

; Do not make any Microsoft-related favorite.
[FavoritesEx]

As you can see, if the FavoritesEx section is empty, no links will be created. This is the preferred form.

Note: The above will not work with IE 7.

Good luck.

Edited by ponghy
Link to comment
Share on other sites

Hi ponghy :)

Thank you very much for your kind help, my friend :)

@All

If anybody knows why my above posted code dosen't work, then i would still really appreciate hearing it, thanks :)

==========POST 2==========

If anyone else should be interested, then here is the answer to my question :

When the 'RunOnceEx' reg key entries is executed, then the user profile hasen't been fully created yet, and hence it isn't possible to e.g. delete the 'FavoritesLinks' folder and the two other '*.url' shortcuts in the 'Favorites' folder. Also if e.g. merging a reg tweak that sets 'Windows Sounds' to 'None', then you will still get sound configured for IE pop-ups and IE's informationbar, because of the above mentioned issue with the execution time of the 'RunOnceEx' reg key entries. I have fixed this problem by only using the 'RunOnceEx' reg key for installing applications and then using the 'Run' reg key for running my 'cleanup.cmd', which then deletes various folders and also merges my regtweaks and then reboots. I tried to use the 'RunOnce' key first, but that key seemed to get executed imidiately after the 'RunOnceEx' key, so that didn't work. Then i tried with the 'Run' key and this worked, as the execution time of that key was first done after the user profile was fully created. I would actually like to use 'RunOnce' instead of 'Run', since it's actually more designed for this purposse i.e. to only run something once and then delete the entries, but since that didn't work, then i had to use 'Run' and get 'cleanup.cmd' to delete the key at the end. I was thinking if it would make any difference if i had used the 'HKCU' version of 'RunOnce' instead of the 'HKLM' ? Would this then have worked ? I don't think so, but just was thinking about it...

Could anybody please explain to me if i'm right in saying that 'RunOnceEx' and 'RunOnce' are executed at about the same time(of course one is run before the other, but nonetheless), and that this time is before the user profile is fully created ? And is it then also correct that the 'Run' reg key is executed at a little later time than 'RunOnceEx' and 'RunOnce' and that at this time then the user profile have been fully created ?

Also, this is how i do it, so please comment if you think that there is a better way :

cmdlines.txt > "C:installhidcon.exe RunOnceEx.cmd"

RunOnceEx.cmd > Sets the entries for installing 8 7z SFX installers + sets the 'Run' reg key to start 'cleanup.cmd'.

cleanup.cmd > Merges a reg file with tweaks and deletes various files/folders + reboots.

This means that from 'RunOnceEx' then the apps are installed(i disable the status window to make the install totally silent with this line : "reg add %key% /v flags /t reg_dword /d 128 /f") and then the desktop is shown and here 'cleanup.cmd' is started from the 'Run' reg key and merges the reg tweaks and deletes some files and folders and then finally reboots after 60 secs.

Normally, then i would just also run 'cleanup.cmd' from the 'RunOnceEx' reg key, but since i couldn't delete the 'Links' folder, couldn't delete some '*.url' shortcuts and also couldn't make the "Disable all Windows sounds" reg tweak work, then i had to use something else, and then i have now choosen the 'Run' reg key, but if you guys have some other way of doing it, then i would be very interested in hearing it, or also just to hear if you guys think that i'm doing it in the best way possible allready ?

Thank's in advance.

==========POST 3==========

OK, the reg keys i have talked about are executed in this running order :

  • HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersionRunOnce
  • HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersionRunOnceEx
  • HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersionRun
  • HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionRun
  • HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionRunOnce

From this, then i can now see that since 'HKLMRun' does work for me in a previous VMware session, then 'HKCURunOnce' would also work and would allow me to not having to also add this command at the end of 'cleanup.cmd' :

reg delete HKLMSOFTWAREMicrosoftWindowsCurrentVersionRun /v cleanup /f

I would just like to hear what you guys thinks about this ? Would you rather use 'HKLMRun' or 'HKCURunOnce' in my situation ? I know that since 'HKLMRun' works, then 'HKCURunOnce' will also work, but i'm just in doubt of which one to select ?

Thank's in advance.

Martin.

Edit :

I apologise to the MOD which edited my last couple of posts into one post - I am very sorry about this, and will not do such a thing again. Again, please accept my sincere apology for this.

Also i just wanted to say that i have now tested a VMware session where i had used 'RunOnceEx' to install my apps and then 'HKCU\RunOnce' to run my 'cleanup.cmd' file and this worked perfectly and so i have decided to use this method also on my finished unattended CD, as the 'RunOnce' reg key is more suited for this job(cleanup.cmd) than the 'Run' key.

Edited by Martin H
Link to comment
Share on other sites

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...