smercer Posted April 24, 2005 Share Posted April 24, 2005 Hi allI 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.batIs 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 More sharing options...
jaclaz Posted April 24, 2005 Share Posted April 24, 2005 Have a look here:http://www.ss64.com/nt/copy.htmlAs 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\StartUptry this:CD C:\WINDOWS\STARTM~1\Programs\StartUpcopy D:\Batfil~1\defrag.batThe 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 More sharing options...
smercer Posted April 25, 2005 Author Share Posted April 25, 2005 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. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now