Announcement

Collapse
No announcement yet.

Batch file help needed

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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

    Comment


    • #3
      @echo off
      copy /y c:\wintmaint\db\*.* "c:\documents and settings\yourlogin\my documents\db\"
      Dr. Ron Paul for President 2008

      Hope for America - http://www.ronpaul2008.com

      Who is Ron Paul? - Why do we need Ron Paul?

      __________________
      CarPC Newbs Start Here: All your questions answered, as if by E.S.P.

      Comment


      • #4
        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.

        Comment


        • #5
          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.

          Comment


          • #6
            use copy2000
            RexBruMet Skin for FrodoPlayer

            Nissan Aux-in MOD


            Originally posted by bgoodman
            We're an international forum, post in whatever langauge you like.

            Comment


            • #7
              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.

              Comment


              • #8
                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.

                Comment


                • #9
                  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

                  Comment

                  Working...
                  X