gpedit Startup Script not working properly...

G

Guest

Hi...

I have a batch file in gpedit startup folder to delete my index.dat files
plus TIF's, Temp files, cookies and history files. All works as it should
except for the index.dat files do not get deleted.

I have just formatted and reinstalled and i'm using the batch file which
worked no problems prior to the reinstallation of XP so I can't understand
what is going wrong.

Have also tried putting the script in the shutdown folder but the result is
the same.

Could anyone suggest something to try please?

Thanks..

Nick
 
P

Pegasus \(MVP\)

nick said:
Hi...

I have a batch file in gpedit startup folder to delete my index.dat files
plus TIF's, Temp files, cookies and history files. All works as it should
except for the index.dat files do not get deleted.

I have just formatted and reinstalled and i'm using the batch file which
worked no problems prior to the reinstallation of XP so I can't understand
what is going wrong.

Have also tried putting the script in the shutdown folder but the result is
the same.

Could anyone suggest something to try please?

Thanks..

Nick

Give your batch file some eyes so that you can see what's going on:

@echo off
echo %date% %time% Start of task > c:\test.log
echo User=%UserName%, Path=%path% >> c:\test.log
del /q "c:\Some Folder\Some Subfolder" 1>>c:\test.log 2>>&1
echo %date% %time% End of task >> c:\test.log

Start your machine, wait for the script to finish then check
the contents of c:\test.log.
 
G

Guest

Hi Pegasus...

Thanks for the reply.

I added the lines to the batch file and the test.log shows the index.dat
files are all in use at the time of the attempted deletion which is kinda
weird....as my previous post says, I used to be able to do this without a
problem previous to the reinstallation.

09/08/2006 5:27:10.53 Start of task
User=,
Path=C:\WINDOWS\System32\GroupPolicy\Machine\Scripts\Startup;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\QuickTime\QTSystem\
C:\DOCUME~1\Nick\Cookies\index.dat
The process cannot access the file because it is being used by another
process.
C:\DOCUME~1\Nick\LOCALS~1\History\History.IE5\index.dat
The process cannot access the file because it is being used by another
process.
C:\DOCUME~1\Nick\LOCALS~1\Temporary Internet Files\Content.IE5\index.dat
The process cannot access the file because it is being used by another
process.
09/08/2006 5:27:10.78 End of task

I know that 4 third party programs lock my index.dat files when Windows is
running (Sygate, SuperAdBlocker, Nokia's PC Suite and SpeedUpMyPC) aswell as
Explorer.exe so I thought i'd dig a little deeper by disabling the items one
by one till the index.dat files were deleted. I found the culprit to be
SuperAdBlocker which is a newer version than I used before which ties in with
why it wasn't a problem before the reinstall.

So, I guess my next question is....do you know how I can delay the
initiation of a program set to start when Windows does? Or is it possible to
make the script run any sooner?

Thanks again,

Nick :)
 
P

Pegasus \(MVP\)

I can suggest a solution if you tell me how exactly
SuperAddBlocker gets invoked. Run msconfig.exe
and check the Startup tab to find out.
 
G

Guest

Thanks for the quick reply :)

Ok..not sure what you need to know so will give all the info for
SuperAdBlocker:

Startup item: SAdBlock
Command: C:\Program Files\Super Ad Blocker\SAdBlock.exe
Location: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

Hope that is what you needed :)
 
P

Pegasus \(MVP\)

That's fine. Now tweak your startup script like so:
@echo off
(delete your various files here)
cd /d "C:\Program Files\Super Ad Blocker"
start /b "Super Ad Blocker" SAdBlock.exe

Lastly you need to run regedit.exe, navigate to
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
and remove the SuperAdBlocker line.
 
G

Guest

Hmmmm something's not right or i'm doing something wrong??? :)

I added the lines to the batch file but superadblocker doesn't start at
startup but if I then run the batch file once Windows is running, the program
loads as expected.

What did I do wrong? :)
 
G

Guest

Also...I just tried taking the superadblocker lines out of the batch file and
left the delete commands, then I made a simple batch to start superadblocker
on its own and put it in the startup list in gpedit after the after the first
batch and it still wouldn't start.....but running the start batch once
Windows has loaded works ok????
 
P

Pegasus \(MVP\)

There may be some dependencies that you're not aware of.
I would try these alternatives:
a) Instead of running the batch file as a startup script via
the system policy, place it into the Startup folder of the
All Users profile.

b) Insert a 1-minute delay to let things settle down:
@echo off
(delete your various files here)
ping localhost -n 60 > nul
cd /d "C:\Program Files\Super Ad Blocker"
start /b "Super Ad Blocker" SAdBlock.exe

c) Create some logs:
@echo off
echo %date% %time:~0,5% > c:\script.log
(delete your various files here)
cd /d "C:\Program Files\Super Ad Blocker"
start /b "Super Ad Blocker" SAdBlock.exe 1 >> c:\script.log 2>>&1
ping localhost -n 10
tasklist >> c:\script.log 2>>&1
Now examine c:\script.log for error messages and to see
if SAdBlock.ex is active.
 
G

Guest

Thanks for the suggestions.....you fixed the problem! :)

I had already tried the first one which would start the program but then for
some weird reason, the problem with the index files was back again.

However, I added the command to delay the operation for a minute and left
the batch in the startup folder and all went well so I then gradually reduced
the delay time to 3 seconds and all is working perfectly.

Thank you very much for your time and help on this matter...I feel that I
have learnt a lot from it.

You are a credit to these newsgroups...keep up the good work :)
 
G

Guest

No probs....

Have another question for you though....have posted a thread but no help as
yet so I figure that you will probably know the answer :)

I'm trying to locate IE's autocomplete store in the registry but not having
any luck as yet. I only want the forms entries such as the stuff I type into
search boxes etc and not the typed URL's or the saved passwords locations.

The reason is that, as i'm clearing all my cache on startup, I thought I
might as well add the autocomplete data to a batch file or registry tweak so
that everytime I log on, everything is clean.

Any help would be cool...so if you know another way to delete the data
(without using the Internet Options applet), I will be extremely grateful.

Cheers...

Nick
 
P

Pegasus \(MVP\)

nick said:
No probs....

Have another question for you though....have posted a thread but no help as
yet so I figure that you will probably know the answer :)

I'm trying to locate IE's autocomplete store in the registry but not having
any luck as yet. I only want the forms entries such as the stuff I type into
search boxes etc and not the typed URL's or the saved passwords locations.

The reason is that, as i'm clearing all my cache on startup, I thought I
might as well add the autocomplete data to a batch file or registry tweak so
that everytime I log on, everything is clean.

Any help would be cool...so if you know another way to delete the data
(without using the Internet Options applet), I will be extremely grateful.

Cheers...

Nick

Sorry, I have no experience in this area. One way to find
out where AutoComplete data is kept is to clear the
AutoComplete register manually, then examining the date
stamps of all files in your profile. If the information is stored
in a file then it would show up straight away. Another is to
export selected registry branches before and after clearing
the register, then using fc.exe to compare the two files.
 
G

Guest

Thank you for the advice....I found the key :)

Took a bit of digging around but I got there in the end thanks to your help.

I have been able to edit the registry key after exporting it and then place
it in my startup folder, but the only downside of that is having to click
'Yes' to merge then 'OK' afterwards. Do you know if it's possible to
sidestep this by perhaps making a script that can do the work without any
interaction from me?
 
P

Pegasus \(MVP\)

This is a difficult call because you're not telling us what
you're actually doing. Running regedit? Attempting to
call the exported key directly? That would be a bad
thing, because then you're relying on associations that
may or may not be active. This won't make for a robust
script. Much better to be explicit like so:
regedit -s c:\SomeKey.reg
 
G

Guest

That worked like a charm!!

I located the registry key to a subkey here:
HKEY_USERS\*****SID****\Software\Microsoft\Protected Storage System Provider\

So I exported the subkey and edited the string data keys so they would get
deleted when the registry file was run i.e:
[-HKEY_USERS\*****etc etc]

Then I made a batch with the command you gave me and everything runs
pefectly, my saved passwords for websites are intact.

Dude...you're freakin' awesome!!! :)

Thanks again :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top