Run a 'batch' file before XP boots in?

  • Thread starter Thread starter Lillly
  • Start date Start date
L

Lillly

Is there anyway to run a command or call a batch file before Win XP boots in
at start-up. I mean similar to the way prior versions of Windows used
autoexec.bat and any linked files?

Thanks
 
Lillly said:
Is there anyway to run a command or call a batch file before Win XP
boots in at start-up. I mean similar to the way prior versions of
Windows used autoexec.bat and any linked files?

Thanks

Depends if you want to have the script run before anyone logs in or if
it runs only for a specific user. For a specific user, use a logon
script. For info on how to assign a logon script, use Start -> Help and
Support and search on "logon script".

You can use Task Scheduler to define events that will run on login
(i.e., per user) or at system startup.

You could always add a shortcut to the Startup group for the All Users
account (rather than just have the shortcut in your own account's
Startup group). But that shortcut only runs after someone logs in.

You could add programs to the registry key:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run

for yourself after logging in, or under:

HKEY_USERS\<sid>\Software\Microsoft\Windows\CurrentVersion\Run

for each specific user account when they login, or under:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

for all users (i.e., it runs before any logins).

Maybe some other respondents know of other methods of running a script
or program on Windows startup or during login.
 
This is in reply to:

*Vanguard* said:
Depends if you want to have the script run before anyone logs in or if
it runs only for a specific user. For a specific user, use a logon etc. etc.
Maybe some other respondents know of other methods of running a script
or program on Windows startup or during login.
______________________________________________________________

Thanks for the suggestion. Unfortunately, these methods all seem to run a
command from within the windows shell. I guess what I'm looking for is a
method to run a command before Windows boots in. Possibly what I want is
not possible under XP. Or maybe, I'm just doing something totally wrong.

I appreciate your time.
 
Lillly said:
Thanks for the suggestion. Unfortunately, these methods all seem to
run a command from within the windows shell. I guess what I'm
looking for is a method to run a command before Windows boots in.
Possibly what I want is not possible under XP. Or maybe, I'm just
doing something totally wrong.

I appreciate your time.

The suggestions to add an entry under the Run key in the
HKEY_LOCAL_MACHINE registry hive or using Task Scheduler to define an
event that runs on Windows startup will run before anyone logs in.

In Windows NT/2000/XP, there is no insecure DOS 16-bit kernel that loads
before the operating system GUI loads and adds another 32-bit kernel as
with MS-DOS or Windows 3.1x/9x/ME. If you want to boot some OS other
than Windows NT/2000/XP then you'll need to get another license for it
and install it (in a different partition to prevent stepping on the boot
sector in the partition for Windows already installed) and use
dual-booting or a multiboot manager.

Also, please disable the promo signature that AVG appends to your posts.
It is considered spam.
 
Lillly said:
As I said, "what I want is not possible under XP".

Well, since you never did divulge what you REALLY want to do,
suggestions are limited by what you actually asked. Without any real
information regarding what you are really attempting, and if you are
trying to use insecure DOS before Windows-anything loads (and for
NT-based versions of Windows that never ever included real DOS mode), I
suppose you could get really tricky and:

- Install DOS in another partition (i.e., different than where is
installed Windows XP).
- Use FDISK on a bootable floppy to designate the DOS partition as the
active primary partition.
- Write the config.sys and autoexec.bat files to do what you want in the
computer. If you are using NTFS, you'll need to use a 3rd party driver
that provides NTFS support under DOS.
- Put whatever commands you want to execute in the autoexec.bat file.
Note that you are still NOT running anything *before* the operating
system has loaded. You are still running the commands under an OS
(i.e., MS-DOS).
- Get a utility that lets you change which primary partition is active
and used for booting, like Powerquest's PQBoot. Then add the command
for it in autoexec.bat so it the system will reboot using the Windows XP
partition.
- Get a utility that lets you reboot the system from a command. Then
add it in autoexec.bat after the one that changed the active primary
partition (to the Windows XP partition).
- When you are in Windows XP, you will need to use the Disk Management
MMC to change the active primary partition back to the one containing
DOS. Or add a shortcut to the All Users Startup group, to the HKLM Run
key, or to Task Scheduler as a Windows startup event that runs the
command-line version of, say, PQBOOT to change the active primary
partition to the one containing DOS. Then on the reboot out of Windows
XP, the DOS partition gets reused.

When you boot, the primary partition with DOS will load and run its
config.sys and autoexec.bat commands. One of the commands in
autoexec.bat changes the active primary partition to the Windows XP
partition and another command afterward will reboot the computer. You
then reboot into Windows XP where the active primary partition gets
switched back to the DOS partition for use on the next reboot.

This operates similary to how multiboot managers work, like Powerquest's
Bootmagic or Terabyte's Bootit NG (BING), except the point is to let you
choose which OS to load, you use it, reboot, and then select a different
OS to use.

There are ways to emulate "what you want" as you asked, but without
knowing "what you need to really do and why" then there are LOTS of
possibilities regarding an unknown actual goal.
 
Lillly said:
Thanks for the suggestion. Unfortunately, these methods all seem to run a
command from within the windows shell. I guess what I'm looking for is a
method to run a command before Windows boots in. Possibly what I want is
not possible under XP. Or maybe, I'm just doing something totally wrong.

There is no such stage in XP. Win95/98 booted through a DOS phase that
allowed an autoexec.bat to run in 16 bit real mode. ME and XP (and all
the NT precursors) do not have this phase and there is no means of
loading things before the shell is loaded in windows
 

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