Skip to content

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

Featured Replies

I have the package created with the folder and files I need copied but I cant get a VB script to work that will do it. any ideas on how I could do that?

 

Any help is appreciated,

 

Thanks

  • Author

Our server team wants everything to be in VB......

  • 4 weeks later...

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...

Join the conversation

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

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.