Hi All,

I'm trying to use a script that sits within the App-V package but after intially launching fine for me when someone else starts to use the application they get a permission denied error.


The scripts function is to do a date/time comparisson against a file that sits within the package versus a file that sits on a server.  If the file on the server is newer than the file within the package then the script copies the file from the server  and should then (theorhetically) overwrite the file within the package.


This is the body of the VBscript that is within the package:


Dim objFSO, strSourceFile, strDestinationFile, objSourceFile, objDestinationFile, dateSource, dateDestination

Set objFSO = CreateObject("Scripting.FileSystemObject")

strSourceFile = "\\ServerName\UAT\AppName\Version\EXE\APP.exe"
strDestinationFile = "Drive Letter:\12345678\AppName\APP.exe"

'strSourceFile = WScript.Arguments.Item(0)
'strDestinationFile = WScript.Arguments.Item(1)

If objFSO.FileExists(strSourceFile) Then

 Set objSourceFile = objFSO.GetFile(strSourceFile)
 dateSource = objSourceFile.DateLastModified

 If objFSO.FileExists(strDestinationFile) Then

  Set objDestinationFile = objFSO.GetFile(strDestinationFile)
  dateDestination = objDestinationFile.DateLastModified

  If dateSource <> dateDestination Then
   objSourceFile.Copy strDestinationFile, True
   If UCase(Right(strDestinationFile, 4)) = ".EXE" Then
    MsgBox "APP has been updated to v" & objFSO.GetFileVersion(strDestinationFile), 64, "APP"
   End If
  End If

  objSourceFile.Copy strDestinationFile, True
   If UCase(Right(strDestinationFile, 4)) = ".EXE" Then
    MsgBox "APP has been updated to v" & objFSO.GetFileVersion(strDestinationFile), 64, "APP"
   End If
 End If

 MsgBox "File not found:" & vbCrLf & vbCrLf & strSourceFile, 48, "Error"
End If


And this is how the paramters of the script are set in the OSD file


   <HREF>%SystemRoot%\System32\wscript.exe //E:VBS //NoLogo DriveLetter:\12345678\APP Name\APP_exe_copy.vbs</HREF>


"DriveLetter" being the designated drive letter we user for the App-V client.


As mentioned we get Permission Denied error at what appears to be the following point of the script

"objSourceFile.Copy strDestinationFile, True" (Line 22, Char 4 accoring to the error prompt)


I have checked the permissions of the package and it appears to be OK and the locations of the file and it's destination are also correct.


I am at a loss as to why it can work for me initially and then not later on.  Any suggestions would be gratefully appreciated.


App-V client is on a Citrix server running in Offline mode with "Allow disconnected operation" enabled.

0 Comments   [ + ] Show Comments


Please log in to comment



Nothing springs immediately to mind here, but here are a few things to look at...

  • Are you enforcing security descriptors?
  • Can the launching user access the server share?
  • Is the file marked as User or Application data? It will copy in for each new user as the new file will sit in the userpkg file.
  • Standard users may not be able to open your mount point drive (Q:\ by default), but you can as an admin. Try using the %SFT_MNT%\<path> variable instead - This might be your issue.

See here for further information about OSD Scripting: http://blogs.technet.com/b/appv/archive/2007/10/11/scripting-within-an-osd-file.aspx

Hope that helps,



Answered 10/30/2013 by: dunnpy
Red Belt

Please log in to comment
Hi Dunnpy Thanks for the response. I have looked in the SPRJ file and can see that Security Descriptors or NOT being enforced. Users do have access to the shared location where the file is stored. The file in question is marked as Application Data. We cannot open the mount point drive natively (either as a User or Admin, but can access it via a CMD prompt or Explorer window run within the bubble. Will try the %SFT_MNT%\ variable as you suggest.
Answered 10/30/2013 by: Hillsmeister
Senior White Belt

Please log in to comment
Answer this question or Comment on this question for clarity