March 8, 200521 yr I have made a script which is placed in c:\ and removes c:\windows\prefecth\*.*. how to make it run every time i press shut down. usually i configure it by the command gpedit.msc in the run box. but i want to make it from the registry (unattended). any ideas?
March 8, 200521 yr Use Logoff script... I cant remember, where in registry it is, but simply run regmon looking for writing to registry and define logoff in policy...
March 8, 200521 yr Whether it's a shutdown or logoff script, all gpedit.msc does is write an entry to the registry. It took me less than 60 seconds to discover (simply by adding a script and then using regedit to search for that name) that the key for shutdown scripts is:HKLM\Software\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Scripts...Adding a script adds multiple keys below that path. You should try adding a script using gpedit and examine the changes. It shouldn't be too hard to then create custom .reg (Or, better yet, WSH scripts using RegWrite) to add shutdown scripts.
March 8, 200521 yr Author i'll try it but...if anyone knows how exactly the registry file should look, please write here. 10x to the people who tried to help
March 9, 200521 yr why not just add it to your startup? Whats it matter if theyre deleted right before you log off or right when you logon? This way all you need to do is make a batch file and toss it in there...
March 9, 200521 yr Author it matters. if you remove your files from the prefetch folder and restart immediately you will see how faster it loads without those files. there is no effect to remove them on startup because later when you use your pc your prefecth folder will be full of files and it will load slow. try this and you'll see better startup speed of windows. i found the keys in the registry and they are as follows: [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Scripts][HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Scripts\Shutdown][HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Scripts\Shutdown\0]"GPO-ID"="LocalGPO""SOM-ID"="Local""FileSysPath"="C:\\WINDOWS\\System32\\GroupPolicy\\Machine""DisplayName"="Local Group Policy""GPOName"="Local Group Policy"[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Scripts\Shutdown\0\0]"Script"="C:\\windows\\system32\\ntbootos.bat""Parameters"="""ExecTime"=hex(b):00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Scripts\Startup][HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System\Scripts][HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System\Scripts\Shutdown][HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System\Scripts\Shutdown\0]"GPO-ID"="LocalGPO""SOM-ID"="Local""FileSysPath"="C:\\WINDOWS\\System32\\GroupPolicy\\Machine""DisplayName"="Local Group Policy""GPOName"="Local Group Policy"[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System\Scripts\Shutdown\0\0]"Script"="C:\\windows\\system32\\ntbootos.bat""Parameters"="""ExecTime"=hex(b):00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System\Scripts\Startup]EDIT: of course you might put ntbootos.bat into system32. my ntbootos.bat is:del "c:\windows\prefetch\*.*" /q
March 9, 200521 yr Well, speeding computer by deleting prefetch file is only hoax... Only time, when it matters is when there is too much prefetching files - I mean after half year or so.Personally I am deleting prefetch directory every month using scheduled tasks...
March 9, 200521 yr Author Well, speeding computer by deleting prefetch file is only hoax... Only time, when it matters is when there is too much prefetching files - I mean after half year or so.Personally I am deleting prefetch directory every month using scheduled tasks...<{POST_SNAPBACK}>i used to think the same way but my computer is p4 2,6 ghz 512 mb ram .... and when the boot screen appeared the blue thing was moving 6-10 times. i tryed everything, boosting programs, registry cleaning programs, even format didn't help. i tryed a program of microsoft which is designed to make booting faster but it didn't help too. one day I read about this in a forum and thought to myself "What will i lose if i try it?". after i tryed the blue thing moved just one time. it really worked. i don't want to lie you, just try!
March 9, 200521 yr Heh, sound strange I am never turning off my computer at works and hibernating at notebook and tablet, so I dont solve problems like this. But prefetching shouldnt cause slow problems like this... Well, but reasons R not important, important is you find your solution and it is working
March 9, 200521 yr Author very good said. thanks to all who helped me making my bat file on unattended installation. very soon my version of windows will be released look for it in the stores
March 9, 200521 yr Correct me if Im wrong, but isnt the entire reason prefetching exists is to speed up loading times of applications? So if you remove these its going to slow down the overall startup time of all of your programs which use it. I dont know about you guys, but I restart my pc maybe once every other week and Id much rather have my programs load up faster over my pc booting up an extra 3 seconds faster.Just my 2 cents.
March 10, 200521 yr 2durex: It depends from person to person - I never turn off my work PCs/NB/tablet, but with my home PC I am usually more time booting than working with it
February 18, 201115 yr I'm trying to run a bat script to kill windows audio services at shutdown due to it hanging. My batch file is in working order as i've checked that out. My problem is the registry.I've input all the data supplied above into the registry (ovbviously changed the file paths! lol) But to no avail.If someone could help me with this it would be awesome.
June 12, 201115 yr Ahh prefetchThere is so much BS spread about it ...enable/disable..how often to clear etcHeres the scoop, according to...well, me1) Install Windows2) install applications3) clear prefetch - you want to do it now because it will have prefetch data for all your setup .exe's and .msi's etc, and you dont need those fetched at boot4) reboot5) go about your life and once every 3 months or so (or more if youre installing lots of software) clear it6) worry about more important things.....
Create an account or sign in to comment