Copy Files

From Wiki

Jump to:navigation, search

Script Language: .bat

Just simply edit the code below to suite what you need it for. If you want to copy more than one folder just add more lines.

<vb> copy "C:\Documents and Settings\All Users\Start Menu\Programs\Microsoft Office\Office Outlook 2007.lnk" "C:\Documents and Settings\All Users\Desktop" </vb>

Script Language: .VBS

Simple Example of copying a file from one place to another, works with unc paths.

<vb> Set FSO =CreateObject("scripting.FileSystemObject") FSO.CopyFile "\\server\share$\test1.txt", "c:\" ,True MsgBox" File Copy Successfull", vbInformation, "" </vb>

Script Language: .VBS

Like above but for copying folders

<vb> Set FSO =CreateObject("scripting.FileSystemObject") FSO.CopyFolder "\\server\share$\foldername", "c:\copyfolder" ,True MsgBox"Folder Copy Successfull", vbInformation, "" </vb>