ProblemYou want to copy or move a set of files or folders to another location on the file system or to another computer. SolutionUsing a graphical user interface
Using a command-line interfaceMoving, copying, and renaming files is pretty straightforward from the command line: > move <Source> <Destination> > copy <Source> <Destination> > ren <Source> <Destination> Using downloadable softwarePowerDesk Pro from VCOM (http://www.v-com.com/product/PowerDesk_Pro_Home.html) has extensive file management and organization features in an easy to use interface. You can use PowerDesk Pro to completely replace Windows Explorer. In addition to the standard edit, move, delete, and search features, PowerDesk Pro comes with an FTP Manager, Sync Manager (for comparing and syncing two folders), Size Manager (for monitoring drive space), and Archive Manager (for compressing and expanding files). You can download a trial version of PowerDesk Pro called PowerDesk Express for free. You can purchase PowerDesk Pro for $49.99. Using VBScript' This code shows how to rename (same as move in WMI) and copy a file ' or folder. ' ------ SCRIPT CONFIGURATION ------ strComputer = "." strCurrentFile = "<CurrentFilePath>" ' Path to existing file or folder strNewFile = "<NewFilePath>" ' New path of file or folder ' ------ END CONFIGURATION --------- set objWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") set objFile = objWMI.Get("Cim_Datafile='" & strCurrentFile & "'") WScript.Echo "Renaming " & strCurrentFile & " to " & strNewFile intRC = objFile.Rename(strNewFile) if intRC <> 0 then WScript.Echo "There was an error renaming the file: " & intRC else WScript.Echo "File rename successful" end if ' ------ SCRIPT CONFIGURATION ------ strComputer = "." strCurrentFile = "<CurrentFilePath>" ' Path to existing file or folder strNewFile = "<NewFilePath>" ' Path to copy file or folder ' ------ END CONFIGURATION --------- set objWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") set objFile = objWMI.Get("Cim_Datafile='" & strCurrentFile & "'") WScript.Echo "Copying " & strCurrentFile & " to " & strNewFile intRC = objFile.Copy(strNewFile) if intRC <> 0 then WScript.Echo "There was an error copying the file: " & intRC else WScript.Echo "File copy successful" end if |