Results 1 to 11 of 11
  1. #1
    2 Star Lounger
    Join Date
    Nov 2004
    Location
    London, United Kingdom
    Posts
    152
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Dos Batch File (win xp)

    Hello

    I am trying to write a simple batch file to copy a file from the s drive to the c drive. I am having problems, I think as the folder names are too long. I would be very gratefull for any tips. I have so far:
    copy s:mis*.xls "c:documents and settingsall usersstart menu"

    Many thanks

    Amanda

  2. #2
    Platinum Lounger
    Join Date
    Jan 2001
    Location
    Quedgeley, Gloucester, England
    Posts
    5,333
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Dos Batch File (win xp)

    I don't see anything obviously wrong -- you have double quotes round any path that contains one or more blanks.

    You could try leaving off the final , or perhaps leave it as it is and use XCOPY rather than COPY?

    John
    <font face="Script MT Bold"><font color=blue><big><big>John</big></big></font color=blue></font face=script>

    Ita, esto, quidcumque...

  3. #3
    Administrator
    Join Date
    Mar 2001
    Location
    St Louis, Missouri, USA
    Posts
    23,335
    Thanks
    5
    Thanked 1,014 Times in 889 Posts

    Re: Dos Batch File (win xp)

    What exactly is the error you are receiving?

    Joe
    Joe

  4. #4
    2 Star Lounger
    Join Date
    Nov 2004
    Location
    London, United Kingdom
    Posts
    152
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Dos Batch File (win xp)

    Hi,

    Error Message is:
    The NTVDM CPU has encountered an illegal instruction.
    Choose 'Close' to terminate the application

  5. #5
    Platinum Lounger
    Join Date
    Jan 2001
    Location
    Quedgeley, Gloucester, England
    Posts
    5,333
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Dos Batch File (win xp)

    Have you tried doing a drag and drop in Windows Explorer, to see if it works that way?
    Or my suggested XCOPY?

    Could it be a Permissions Thing?

    John

    PS You do have SP2 applied, do you?
    <font face="Script MT Bold"><font color=blue><big><big>John</big></big></font color=blue></font face=script>

    Ita, esto, quidcumque...

  6. #6
    2 Star Lounger
    Join Date
    Nov 2004
    Location
    London, United Kingdom
    Posts
    152
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Dos Batch File (win xp)

    I do have permissions. I have tried xcopy and that didn't work. But I don't know what SP2 is, so I don't know if it is applied.

    thanks

    Amanda

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: Dos Batch File (win xp)

    SP2 stands for Service Pack 2 for Windows XP. You can check if it is installed by selecting Help | About Windows in Windows Explorer (or My Computer).

  8. #8
    Platinum Lounger
    Join Date
    Jan 2001
    Location
    Quedgeley, Gloucester, England
    Posts
    5,333
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Dos Batch File (win xp)

    What error message did you get when you tried XCOPY, please?

    And did it work when you tried Drag and Drop with Windows Explorer?

    John
    <font face="Script MT Bold"><font color=blue><big><big>John</big></big></font color=blue></font face=script>

    Ita, esto, quidcumque...

  9. #9
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,265
    Thanks
    2
    Thanked 187 Times in 173 Posts

    Re: Dos Batch File (win xp)

    Hi Amanda,
    A couple of quick questions:
    1. Do other batch files work OK or do they all fail?
    2. If they all fail, can you post the contents of your autoexec.nt and config.nt files - they are located in C:WindowsSystem32 by default.
    Regards,
    Rory

    Microsoft MVP - Excel

  10. #10
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,265
    Thanks
    2
    Thanked 187 Times in 173 Posts

    Re: Dos Batch File (win xp)

    Amanda,
    One more thing that occurs to me:
    I take it you did give the file a .bat extension - if you named it .exe you would get the symptoms you describe.
    Regards,
    Rory

    Microsoft MVP - Excel

  11. #11
    2 Star Lounger
    Join Date
    Nov 2004
    Location
    London, United Kingdom
    Posts
    152
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Dos Batch File (win xp)

    Rory,

    You star! I was saving it as an exe. It has been so long since I have written batch files and assumed it was something to do with the long names, as back in the day, they didn't even exist.

    Thanks a million for all your suggestions

    Amanda

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •