Results 1 to 9 of 9

Thread: Batch file help needed

  1. #1
    "Speaker of the Truth" veedubya's Avatar
    Join Date
    Nov 2001
    Posts
    265

    Batch file help needed

    I am not really sure where this request for help thread should go but here goes.

    I have been racking over this for a few hours. I need a small batch file that will copy a specific folder i.e C:\winmaint\db and paste it into My Documents. I have a db folder that has recently been shared out to another user and this new user has been known to muck things up. So this "what i thought was simple" batch file could be placed in scheduler to automate the backup process.

    (c:\winmaint/db) ---------------> (my documents/db)

    Any batch examples would be greatly appreciated

    thx.
    "Geeks dont need girlfriends we can ping ourselves"

    Sony Vaio 2Ghz 40G HHD, Routis 2004 GPS, 7" VGA TS Lilliput, BackUp Camera running RoadRunner with Simplistique Skin.

  2. #2
    Maximum Bitrate sfay93's Avatar
    Join Date
    Feb 2004
    Location
    Omaha, NE
    Posts
    777
    Do you want them copied or moved?
    7" Lilli TS, Soyo K7VME, Semperon 2200, 160GB Maxtor, 512mb PC3200, Deluo GPS, Panasonic Slim DVD/CD RW, Linksys WMP545G , Opus 150w, XMDirect, XP Pro, FP, IG [XXXXXXXXX-] 90%
    ATVMS.com

  3. #3
    Raw Wave tj!2k4's Avatar
    Join Date
    Oct 2004
    Posts
    3,294
    @echo off
    copy /y c:\wintmaint\db\*.* "c:\documents and settings\yourlogin\my documents\db\"

  4. #4
    "Speaker of the Truth" veedubya's Avatar
    Join Date
    Nov 2001
    Posts
    265
    copied... because the software has the exact location hardcoded in it, I just want an exact copy somewhere out of the hands of the "problem" user
    "Geeks dont need girlfriends we can ping ourselves"

    Sony Vaio 2Ghz 40G HHD, Routis 2004 GPS, 7" VGA TS Lilliput, BackUp Camera running RoadRunner with Simplistique Skin.

  5. #5
    Low Bitrate
    Join Date
    Nov 2004
    Location
    Northern VA
    Posts
    87
    xcopy C:\winmaint\db\*.* "%USERPROFILE%\My Documents\db\*.*" /y /h /k /i /c /e

    Just put that line in a batch file and it should do what you want.

    %USERPROFILE% is a global dos variable that equals the current user's path (e.g. C:\Documents and Settings\YourUserName)

    The switches are as follows:

    /C Continues copying even if errors occur.
    /I If destination does not exist and copying more than one file, assumes that destination must be a directory.
    /E Copies directories and subdirectories, including empty ones.
    /H Copies hidden and system files also.
    /K Copies attributes. Normal Xcopy will reset read-only attributes.
    /Y Suppresses prompting to confirm you want to overwrite an existing destination file.


    Good luck, lemme know if you have any questions.

  6. #6
    Para Laura thanatos106's Avatar
    Join Date
    Nov 2004
    Location
    Miami Beach,FL U.S.A
    Posts
    3,497
    use copy2000

  7. #7
    "Speaker of the Truth" veedubya's Avatar
    Join Date
    Nov 2001
    Posts
    265

    thx

    thx all - seems eleventh has me on the right track
    "Geeks dont need girlfriends we can ping ourselves"

    Sony Vaio 2Ghz 40G HHD, Routis 2004 GPS, 7" VGA TS Lilliput, BackUp Camera running RoadRunner with Simplistique Skin.

  8. #8
    Variable Bitrate BMVEE's Avatar
    Join Date
    Mar 2005
    Location
    Beautiful British Columbia, CANADA.... eh!
    Posts
    256
    If you're really adventurous, you can type xcopy /? at the command prompt. That'll give an explanation of ALL of the command line switches

    I think that Eleventh has nailed it for you though.

  9. #9
    Maximum Bitrate d_sellers1's Avatar
    Join Date
    Mar 2002
    Location
    Austin, Texas
    Posts
    856
    Quote Originally Posted by eleventh
    xcopy C:\winmaint\db\*.* "%USERPROFILE%\My Documents\db\*.*" /y /h /k /i /c /e
    That's one hell of a command line. Looks like it should work. Like the use of the %USERPROFILE%. I just learned about that one (by messing around in the Registry) last night.

    Derek
    Progress [||-------]
    View my Worklog to see some of my progress.
    Downgraded Progress - Starting with another car... 09/13/06

Similar Threads

  1. batch file "pause" question
    By grandamp3 in forum Software & Software Development
    Replies: 11
    Last Post: 02-20-2008, 10:07 PM
  2. Need a little help with batch file
    By BlueGrimRX8 in forum Software & Software Development
    Replies: 4
    Last Post: 01-12-2005, 07:10 AM
  3. batch file programming LCD's
    By mosh in forum LCD/Display
    Replies: 6
    Last Post: 05-19-2002, 01:55 AM
  4. batch file playlist creation size limit?
    By AndyM in forum Software & Software Development
    Replies: 6
    Last Post: 08-08-2001, 01:06 AM

Bookmarks

Posting Permissions

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