The following script was written for me. My problem is that when our remote deployment system executes the script, Powershell on the local machine will not run the script. It has no problem running .vbs though. Long story short, our remote deployment software copies this .zip file to all machines that are not connected to our domain. This script then is supposed to unzip the files into a specific location.
Without getting too much more complex, is there a way to convert this function into an easy .vbs or would there be a way to use a batch command to enable the powershell to execute this script on all workstations I need to?
Set oShell = CreateObject( "WScript.Shell" )
user=oShell.ExpandEnvironmentStrings("%UserName%")
comp=oShell.ExpandEnvironmentStrings("%ComputerName%")
USRPROFILE = oshell.expandenvironmentstrings("%UserProfile%")
Appdata = USRProfile & "\AppData\"
sZipFile = "C:\ProgramData\CentraStage\Packages\377fa3f4-6b60-4ec5-94b9-fc1716d53ea9#\vidistar.zip"
sTargetFolder = appdata
Dim oShellApp:Set oShellApp = CreateObject("Shell.Application")
Dim oFSO:Set oFSO = CreateObject("Scripting.FileSystemObject")
'Create the target folder if it isn't already there
If not oFSO.FolderExists(sTargetFolder) Then
oFSO.CreateFolder sTargetFolder
wscript.echo sTargetFolder & " Folder Has Been Created "
end if
'Extract the files from the zip into the folder
oShellApp.NameSpace(sTargetFolder).CopyHere oShellApp.NameSpace(sZipFile).Items