Batch file to move documents

Discussion in 'Software' started by charlie123, Dec 14, 2011.

  1. charlie123

    charlie123 Private E-2

    hi

    Im tying to setup folder redirection, but need to move the current documnets from say: f:\users\<Username>\ to f:\users\<username>\My Documents\ is there a way to do this quickly, in the past i have done it manually on networks with only a few users, but this one has hundreds of users and will take forever...

    Previously documents were mapped via the home folder oopption for weach user, they had a drive h: mapped to \\server\staffhome$\<username>, so ticking the option in folder redirection to move documents to new location doesnt work and id rather do it automatically by vbs or batch file if poss

    thanks
     
  2. PC-XT

    PC-XT Master Sergeant

    Does the f:\users\<username>\My Documents folder already exist for every username, or would it need creating? Also, do you just need files moved, or folders, as well?
     
  3. markem

    markem Private First Class

    First - what language? PHP, Perl, C/C++, Basic, Shell Script?

    In PHP there is a command called mkdir which you can flag to auto-create any sub folders you may need. Check out the online PHP documentation. There is also a ready make file copy command in PHP as well.

    The same is in Perl as for PHP.

    In C/C++ you'd have to do all of the work yourself to set things up to copy.

    In some basics (like FreeBasic) there are commands to make directories and to copy files over as well - but unlike PHP/Perl - you have to set things up pretty much yourself to work.

    Shell scripts are like C/C++ - you set everything up yourself to work.

    I would do this in PHP as that is set up to handle the vagaries of websites and they have made everything fairly simple. Just go to the PHP website, click on the documentation link, keep that tab open so you can reference things when you need it, and look up the mkdir command and copy commands. They really are that simple to use. :)
     

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