VBScript Basics, Part 29 | Get File – Folder (Methods)


VBScripting (.vbs) Basic tutorial on how to copy, move, delete, and openastextstream, on a file of folder.

Code Example:
______________________________________________________

Option Explicit
Dim objFSO, objFile, objFolder

Set objFSO = CreateObject(“Scripting.FileSystemObject”)

Set objFile = objFSO.GetFile(“C:UsersJeremyDesktopmyfile.jpg”)
Set objFolder = objFSO.GetFolder(“C:UsersJeremyDesktopmyfolder”)

objFile.Copy “destination folder”
objFile.Move “destination folder”
objFile.Delete
objFile.OpenAsTextStream(IOMode).commands

objFolder.Copy “destination folder”
objFolder.Move “destination folder”
objFolder.Delete
______________________________________________________