Page 1 of 1

Script permissions to delete/move

PostPosted: Thu May 24, 2012 9:00 am
by dpayer
Using a VB method within a SELECT CASE
(only showing relevant case)
Code: Select all
FolderAction = publication.nbGetVar( "[%3]" )
SecondaryFolder = publication.nbGetVar( "[%2]" )
PrimaryFolder = publication.nbGetVar( "[%1]" )
MsgBox ("Primary Folder: " & PrimaryFolder &Chr(13)& "Secondary Folder: " & SecondaryFolder &Chr(13)& "Folder Action: " & FolderAction )
Select Case FolderAction
       Case Delete

       Set objFSO = CreateObject ("Scripting.FileSystemObject")
 
      objFSO.DeleteFolder PrimaryFolder, force
       End Select

set objFSO=nothing


When the NB var for the PrimaryFolder is set to e:\temp4, the vb script verifies this via the MSGBOX (and with a separate NB alertbox) but the script does not delete the folder and its contents.

When I run this vbscript from a command prompt:
Code: Select all
       Set objFSO = CreateObject ("Scripting.FileSystemObject")

      objFSO.DeleteFolder "e:\temp4", force


it does delete the folder.

Do scripts run via NB have a different permission than those run from a command prompt?

PostPosted: Thu May 24, 2012 10:18 am
by Neosoft Support
Do scripts run via NB have a different permission than those run from a command prompt?


A VBScript run from NeoBook should have the same permissions as those assigned to your pub (see Book Properties > Version Info).

You could try running your compiled pub as an administrator and see if that makes any difference. You could also see if the VBScript returns any error codes that might be helpful in diagnosing the problem.