Emulate gpedit.msc in XP Home

Status
Not open for further replies.

lazerman

Fully Optimized
Messages
1,842
I had to go out and purchase XP Home because Bill Gates didn't think I had already paid enough for my legally licensed copy of XP Pro... So now I am trying to get a shutdown script to work with gpedit.msc. I type it in the run box dialogue and it doesn't exist. I google gpedit in xp home and numerous people say it doesn't have it. Well that's okay since all gpedit does is add regkeys, so I could do it through regedit. I am having a real time trying to figure out where to put it in there, I don't want to screw anything up... I stuck it in the Run folder under CurrentVersion and it did something with the batch file at boot, like it ran but it didn't delete anything... I guess it needs to be a program that I have startup or are those just processes? The script I am trying to run is one that cleans crap off my computer everytime I shut it down. Here is the text from the batch file-

del "C:\Documents and settings\*\Local Settings\Temporary Internet Files\Content.ie5\*\*.*/q"
del "C:\Documents and settings\*\Local Settings\Temporary Internet Files\Content.ie5\index.dat/q"
del "C:\Documents and settings\*\Local Settings\Temp\*.*/q"
del "C:\Documents and settings\*\Local Settings\Temp\*/q"
del "C:\Windows\Temp\*.*/q"
del "C:\Windows\Temp\*/q"

That worked before through gpedit as a batch file... how do I make it an executable or leave it a batch file and have a shutdown script section in the registry. Any help is appreciated.
 
I don't think it will work. The group Policy functions are not allowed on XP Home cause it's not designed for that as far as I understand it.
something you can do would be the writing a program to do this for you and then run that when you go to shutdown.

You will need shutdown.exe to do this... This is done in Perl. If you want to use it, download the perl 5.8.6 library from Activestate.org

Code:
my $sys = $ENV{SystemRoot};
my $user = $ENV{USERPROFILE};
$path1 = "Local Settings\\Temporary Internet Files";
$path2 = "Local Settings\\Temp";
rmtree(["$user\\$path1", "$user\\$path2"], 1, 1);
mkpath(["$user\\$path1", "$user\\$path2"], 1, 0711)
system ("$sys\\system32\\shutdown.exe -r -t 00 -f);

That should do it. Call the file shutdown.pl and drop it in %systemroot%. Then place a shortcut on your start menu pointing to "%SystemDrive%perl\bin\perl.exe %systemroot%\shutdown.pl"

That should do it for you.
Then when you want to reboot, click on it.
If you want to shutdown, change the following line:
system ("$sys\\system32\\shutdown.exe -s -t 00 -f);

Hope that helps...
 
Status
Not open for further replies.
Back
Top Bottom