Need Batch file that runs whenever Windows is closed!

  • Thread starter Thread starter Don J
  • Start date Start date
All the documents I find do a good job at describing how to insert a logoff
script when one is using Windows XP Professional. However I am using
Windows XP Home Edition. None of the documentation I find covers the case
of XP Home. Apparently the directory %SystemRoot% (which is hidden) plays
an important part in XP Professional. But I don't find it in XP Home.

Don J
 
%systemroot% is an environment variable that holds the path to your windows
directory.
You can goto the command prompt and type echo %systemroot% . This will print
the directory path.

E.g.: If I have windows installed on C: drive then %systemroot% will store
the value C:\WINDOWS
 
%systemroot% = %windir% = c:\windows on most computers. You may have decided to call the windows directory Don when installing Windows. On your computer typing %systemroot% (or the older %windir% which is easier to type) will be c:\don on your computer but c:\windows on everyone else's computer (who did not change the default name).

Windows NT used WinNT and not Windows as it's default name. Refering to %systemroot% always refers to the correct directory on any computer no matter how configured by the user.
 
I misstated my problem in my second posting at 9:57 PM. The sentence that
reads: "Apparently the directory %SystemRoot% (which is hidden) plays an
important part in XP Professional". Directory "%SystemRoot%" should have
been "%SystemRoot%\System32\GroupPolicy".

I would like to ask someone to address the issue I raise in my original
Post, concerning a method of running a batch file at logoff, in Windows XP
Home Edition.

Don J
 
If you are running a batch file that has a dependency on Group policies,
then you simply cannot find anything that will work on XP Home.

Bobby
 
The batch file is already written and running during startup. It is being
started by placing it in the "Startup" folder on the Start Menu. So I doubt
that it is dependent on Group Policies.

Don J
 
Since all automajical running of scripts at shutdown normally require the
bells & whistles that were left out of XP home (as you have discovered, GP
being the major one), why don't you create a shortcut to your batch file on
the desktop or on the startup/programs area. Then, in the last line of your
batch file, add the appropriate "rundll32 command" that instructs the
computer to "shutdown". Check the KB for the correct command, but there is
a restart, shutdown, logoff, etc options for rundll32 program.

--
Star Fleet Admiral Q @ your service!
"Google is your Friend!"
www.google.com

***********************************************
 

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

Back
Top