Script to copy a folder
Scripting language is very handy tool for system admins, if u learned the scripting. we can finish the work as fast.Today , here i would like to write a script about how to copy a folder. Copy the below code to notepad and save it as .vbs extension. And edit the source and destination in the script.
__________________________________________________________________________________
sFolder = "c:\testfolder"
dFolder = "\\remoteservername\sharename"
Set objFSO = CreateObject ("scripting.fileSystemObject")
objFSO.CopyFolder sFolder, dFolder
Script to create a folder
A simple VB script can create a folder on a system. Folder creation is very simple all are known, but why I write this script, because if we want create a folder on all system, we can use this on logon script through group policy.
1) Open your notepad, copy the below code.
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.CreateFolder("c:\Serveradmin")
msgbox “Successful created”
And save as .vbs extension and execute it, now you check the “C” drive, the folder is created.
No comments:
Post a Comment