Details
- OS: Windows 7
- UAC: Disabled
- What: I am running a VBScript that extracts a zip file, and the vbscript is kicked off by Jenkins service. I need to use the VBScript, and I can not use external tools that do not exist in a clean windows installation.
- Problem: If the service is running as NT Authority\SYSTEM OR as a local administrator, I get an error message on screen related to the vbscript unzipping. Running the script as the current user produces no problems at all. Error message is titled: Interactive Services Detection. Dialog text says A program running on this computer is trying to display a message.
If you click "view the message" you get a very old looking dialog titled: Folder Access Denied with the text You'll need to provide administrator permission to copy this folder.
It seems like it would somehow UAC related, except UAC is supposedly disabled.
- Script:
Const noProgressYesAll = &H14
Dim objFSO
Set objFSO = CreateObject("scripting.filesystemobject")
zipFile = "C:\test.zip"
unzipPath = "C:\test\"
WScript.Echo "ZIPEXTRACTDIR: " & unzipPath
WScript.Echo "ZIPFILE: " & zipFile
If objFSO.FileExists(zipFile) Then
If objFSO.FolderExists(unzipPath) Then
Set objShell = CreateObject( "Shell.Application" )
Set objSource = objShell.NameSpace(zipFile)
If objSource is Nothing Then
printMsg "Invalid Zip File " & zipFile
Else
unzipLog = zipFile&".log"
printMsg "Logging to " & unzipLog
Set objLog = objFSO.OpenTextFile(unzipLog,fsoForWriting,True)
Set objTarget = objShell.NameSpace(unzipPath)
objTarget.CopyHere objSource.Items, noProgressYesAll
For Each item in objSource.Items
printMsg "Extracted: " & unzipPath&item.Name
objLog.Write unzipPath&item.Name & vbCrLf
If objFSO.FileExists(unzipPath&item.Name) Then
printMsg "Verified File: " & unzipPath&item.Name
Else
If objFSO.FolderExists(unzipPath&item.Name) Then
printMsg "Verified Folder: " & unzipPath&item.Name
End If
End If
Next
objLog.Close
End If
Else
printMsg "Directory does not exist: " & unzipPath
End If
Else
printMsg "Zip file does not exist: " & zipFile
End If
Set objLog = Nothing
Set objSource = Nothing
set objShell = Nothing
set objTarget = Nothing
WScript.Echo
and theprintMsg
(which appears to have no correspondingSub
so will fail with an error if it gets called) and then running it withwscript
? That would prevent a command window appearing - which may be what is triggering that pop-up.objTarget.CopyHere
call.