2

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. First Dialog that appears

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. Second Dialog that appears

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

5
  • You have a fair few WScript.Echo's in there which would try and display a pop-up window.
    – Richard
    Jan 24, 2013 at 18:53
  • I suppose I should have added: it is being run w/ cscript, so all output is put into the command window, not as a popup.
    – NGaida
    Jan 24, 2013 at 21:06
  • Have you tried commenting out the WScript.Echo and the printMsg (which appears to have no corresponding Sub so will fail with an error if it gets called) and then running it with wscript? That would prevent a command window appearing - which may be what is triggering that pop-up.
    – Richard
    Jan 24, 2013 at 22:10
  • Yes. I forgot to include the printMsg routine, which for this instance is a WScript.Echo.
    – NGaida
    Jan 24, 2013 at 23:20
  • @Richard However is not causing this issue at all; the error clearly shows that it is a permissions problem with the objTarget.CopyHere call.
    – NGaida
    Jan 24, 2013 at 23:41

0

You must log in to answer this question.

Browse other questions tagged .