Jump to content


  • 0
ChrisV

Need VB script to copy a folder and contents in Task sequence

Question

3 answers to this question

Recommended Posts

  • 0

Here's a VBScript code snippet that might help:

 

strScriptFileDirectory = objFSO.GetParentFolderName(wscript.ScriptFullName)

WinDir = objWshShell.ExpandEnvironmentStrings("%windir%")

 

If objFSO.FileExists (strScriptFileDirectory & "\MyFile.txt") Then

objFSO.CopyFile (strScriptFileDirectory & "\MyFile.txt"), (WinDir & "\Folder1\SubFolder2\MyFile.txt"), True

End If

 

You'll need to mess with variables or drop back to hard-coded paths, but see if that helps get you started...

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.