HELP with CMD command

Discussion in 'Software' started by metroplex, Sep 18, 2006.

  1. metroplex

    metroplex Private E-2

    Hello on my hard drive in Tutorials i have a lot of documets in this address as shown:

    "C:\Documents and Settings\metroplex\My Documents\Tutorials"

    I want to create an .exe or a .cmd and when i click on it, it will copy the documents from this address and save them on floppy disc a:/

    i dont know to many commands but i think it is possible to make

    can someone help me out? thanks in advance
     
  2. Mada_Milty

    Mada_Milty MajorGeek

    Code:
    xcopy C:\Documents and Settings\metroplex\My Documents\Tutorials\*.* a:\*.* /ekdicy
    If you were to copy the above into notepad and save as filename.bat, you would have a script that copied JUST the new files (ie ones that aren't already on a: ) in the tutorials folder to the a drive.
     
  3. metroplex

    metroplex Private E-2

    i did this but i got the following message:

    'xcopy' is not recognized as an internal or external
    command, operatable program or batch file
     
  4. TimW

    TimW MajorGeeks Administrator - Jedi Malware Expert Staff Member

    xcopy is a sweet app. IIRC, it comes with windows 2K. To confirm, please do the following:

    1. Hit windows key + r (or click Start --> Run)
    2. Type 'cmd' (without the quotes)
    3. Hit enter (or press 'OK')
    4. Type 'help' (without the quotes)
    5. Press enter

    This should give you a list of all the DOS commands available to you. Xcopy should be among them. If so, we can find info about it. To do so, please do the following:

    1. At the command prompt, type 'xcopy /?' (without the quotes)
    2. Press enter

    This will give us the syntax of the xcopy command, and the usage of all its switches.
     
  5. metroplex

    metroplex Private E-2

    i got a simmilar message:

    'help' is not recognized as an internal or external
    command, operatable program or batch file

    whats going on?
     
  6. Matacumbie

    Matacumbie Rocky Top

  7. TimW

    TimW MajorGeeks Administrator - Jedi Malware Expert Staff Member

    What operating system are you using?
     
  8. metroplex

    metroplex Private E-2

    XP with service pack 2

    i'm going to try that fix and tell you if it works
     
  9. TimW

    TimW MajorGeeks Administrator - Jedi Malware Expert Staff Member

    It's probably the PATH environment variable. Open a command prompt and type "path" (no quotes). You will see PATH= followed by a list of directories separated with semicolons. Is c:\windows\system32 there?

    If not, go to Control Panel -> System -> Advanced -> Environment variables. Scroll the 'system variables' to find PATH, select it and click Edit. Copy its contents to a notepad window, it's much harder to edit a very long string in that little box.

    When windows is first installed that variable is:
    %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem

    Put these at the beginning. Delete from anywhere else. Copy back to the little box, click OK twice. You will need to restart running applications to apply the new path to them, not the system.

    As In:
    If you get an error as a result of typing xcopy in command prompt, one or both conditions are true:
    The xcopy.exe file is missing. To test, type its full pathname (%windir%\system32\xcopy.exe) in the command window. If you get a "not recognized" error again, insert your windows cd and start->run "c:\windows\system32\sfc /scannow"... If "invalid number of parameters" is the response, you could use the full pathname each time you want to use xcopy. But it's better to correct the problem.
    The PATH variable is not as it should be. Type PATH (this will work since it's a built-in command), it will show you the variable's content. It is a semicolon-separated list of directories and "c:\windows\system32" should be there. If it's not, correct it because this may cause other problems.
    Go to C.Panel, System, Advanced tab, click Environment Variables. In the "system variables" list scroll down to find Path (the order is alphabetical). If you don't find it, click New, enter Path as name and copy/paste this value:
    %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem

    If it's there, select it, click Edit and prepend this to its value:
    %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;
     
  10. metroplex

    metroplex Private E-2

    as a path i got this:

    %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\system32\Wbem;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Executive Software\Diskeeper\

    should i replace the whole thing with this?

    %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem


    :))) Ok i replaced the whole thing and both "help" and "xcopy" work fine now!!

    i'm going to try that .bat now!!! thanks for all your help!! that was awesome!!
     
    Last edited: Sep 18, 2006
  11. TimW

    TimW MajorGeeks Administrator - Jedi Malware Expert Staff Member

    Back up first (system restore point ) ...then delete that other stuff to just what you have ....

    In a word, yes.
     
  12. metroplex

    metroplex Private E-2


    i got invalid number of parameters this time :(
     
  13. Mada_Milty

    Mada_Milty MajorGeek


    its probably the switch, which is my mistake...try separating

    /ekdicy into /e /k /d /i /c /y
     
  14. mulletgut

    mulletgut Private First Class

    Is all this easier than -------> right click>send to>31/2 Floppy (A:)
    I do realise it's most certainly MajorGeekier but..............
     
  15. theefool

    theefool Geekified

    I'm on vista right now, but isn't /d related to a date field?
     
  16. TimW

    TimW MajorGeeks Administrator - Jedi Malware Expert Staff Member

    The thread isn't about "copy to disc" so much as it is getting a script to work using xcopy.

    So, yes it is a major geeky thing.
     
  17. metroplex

    metroplex Private E-2

    it still wouldnt work but i think we are getting somewhere! can someone of you guys check it out at a random address on your system? because perhaps my path still has a problem, although i get invalid parameter :(
     
  18. Mada_Milty

    Mada_Milty MajorGeek

    OH NO!

    Again, my mistake...try wrapping the paths in quotes...if it sees a space in say, "documents and settings", it will take "and" as a parameter!

    Sorry I'm being such a duh-head here!
     
  19. metroplex

    metroplex Private E-2

    thanks and no problem. so how should i rewrite it the whole thing? :S
     
  20. Mada_Milty

    Mada_Milty MajorGeek

    Code:
    xcopy "C:\Documents and Settings\metroplex\My Documents\Tutorials\*.*" a:\*.* /e /k /d /i /c /y
    Here is the complete line of code you will need. The quotes around the source path should help you with the invalid parameters error.
     
  21. metroplex

    metroplex Private E-2

    Yes that is it!!!! thank you so much!!! :)
     
  22. Mada_Milty

    Mada_Milty MajorGeek

    I'm glad we've finally got it working for you. Sorry it took me so long to work out my silly mistakes!
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds