Jump to content

Make bat file execute on windows startup from DOS


smercer

Recommended Posts

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:

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!

Link to comment
Share on other sites


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:

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

try this:

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

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...