Help - Search - Members - Calendar
Full Version: Make bat file execute on windows startup from DOS
MSFN Forums > Microsoft Software Products - Discussion & Support > Windows 95/98/98SE/ME

   
Google Internet Forums Unattended CD/DVD Guide
smercer
Hi all

I have come up against an unexpected problem, I have got a batch file that executes in DOS Mode to copy a file on my D drive to the Start menu\Programs\Startup directory. but it does not work, and I get an error "Bad filename or command". Here is part of my code:

CODE
copy D:\Batfil~1\defrag.bat C:\WINDOWS\STARTM~1\Programs\StartUp\defrag.bat


Is there a way to make msconfig start it instead? or am I overlooking something really obvious?

Can someone please help me? Thank you!
jaclaz
Have a look here:
http://www.ss64.com/nt/copy.html

As a general rule, unless you do need to change the name of the file, the destination path is sufficient:
CODE
copy D:\Batfil~1\defrag.bat C:\WINDOWS\STARTM~1\Programs\StartUp


try this:
CODE
CD C:\WINDOWS\STARTM~1\Programs\StartUp
copy D:\Batfil~1\defrag.bat


The first line changes directory to the destination.
The second one copies to the current dir the file.

It could be some problem with the 8.3 naming, the above should help in troubleshooting.


jaclaz
smercer
Thanks, I got it fixed by having it change directory to the file location and then just put in the filename without location.

Thanks for your help.
Google Internet Forums Unattended CD/DVD Guide
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.