Computer Hope

Microsoft => Microsoft Windows => Windows NT/2000 => Topic started by: rockerest on February 22, 2006, 08:04:23 PM

Title: autoexec.bat
Post by: rockerest on February 22, 2006, 08:04:23 PM
How do I add a batch file to the autoexec.bat file so that it will run?  Before I edited it, my autoexec file was empty, now the only line is:
Code: [Select]
call start.batIt doesn't work.  There is a .bat file in the same folder (C:\) named start.bat, but nothing happened.  The start.bat file is a very simple batch file I've written myself, consisting of a simple reminder to myself (more a test than anything) and contains these lines:
Code: [Select]
@echo off
echo Windows is Starting
ping -n 1 -w 2000 1.1>nul
echo Remember to change the outgoing server in Thunderbird to the correct outgoing mail POP server
ping -n 1 -w 2000 1.1>nul
cls
echo Windows is Starting
ping -n 1 -w 2000 1.1>nul
cls
echo Windows is Starting .
ping -n 1 -w 2000 1.1>nul
cls
echo Windows is Starting ..
ping -n 1 -w 2000 1.1>nul
cls
echo Windows is Starting ...
ping -n 1 -w 2000 1.1>nul
pause

Is there a setting I need to set in order for autoexec.bat to automatially run whenever the computer boots?

thanks, rock


edit #1:
Sorry:
I'm running Windows XP SP2, I think that's all the pertinent info.....
Title: Re: autoexec.bat
Post by: Dusty on February 23, 2006, 12:35:51 AM
I understand that Autoexec.bat is not used when XP boots only when you run cmd or command.  You could try adding your .bat file in the Startup.

Title: Re: autoexec.bat
Post by: Backdated on February 23, 2006, 02:48:01 PM
Try running it from c:\windows\autoexec.nt
Title: Re: autoexec.bat
Post by: rockerest on February 24, 2006, 01:20:07 AM
I assume you mean c:\windows\system32\autoexec.nt since c:\windows\autoexec.nt doesn't exist.
I added these two lines to autoexec.nt
Code: [Select]
REM start boot.bat
call %SystemRoot%\boot.bat
But it didn't work.
I have moved the boot.bat file to C:\Windows, since that's where %SystemRoot% points...

Thanks for the idea, any more?

-rock
Title: Re: autoexec.bat
Post by: Sidewinder on February 24, 2006, 05:31:34 AM
Autoexec.nt is used to initialize the MS-DOS Prompt environment (command.com). Windows initializes the Command Prompt environment (cmd.exe). If you want a file to start with Windows, create a shortcut to the file in the startup folder (Start-->All Programs-->Startup)

As mentioned, autoexec.bat is not used on NT machines (includes Win2000 & WinXP)

Good luck.  8-)