Forum Discussion

swightman's avatar
swightman
New Contributor
10 years ago

Losing local folder permissions after copying to remote system

When running this script locally on Win7 it works fine, however when I run it via TestComplete on a remote Win7 system I lose the permissions on the original folder.



The script:



function GetCalibrationData()

{

  var myObject = new ActiveXObject("Scripting.FileSystemObject");



  var myFolder = myObject.GetFolder("c:\\Data\\Data");

  myFolder.Copy("c:\\", true);

}



After calling that script within a master script in TestComplete the C:\Data\Data folder is copied to the remote system and the (source) c:\Data folder loses all permissions, I have to take ownership and find there are no accounts listed in permissions. I can run that same script via TestComplete multiple times on different remote systems, yet when I attempt to run a subsequent script that points to C:\\Data\\One instead of C:\\Data\\Data it fails because of those missing permissions. I'm unable to determine how or why the folder permissions are disappearing, any help would be greatly appreciated.

1 Reply

  • swightman's avatar
    swightman
    New Contributor
    This actually appears to be caused by ABS. Moderator(s), if any, please move this as applicable.



    I continued to investigate, swapped the script for a batch file to run locally on the remote system via TestComplete instead, reduced the # of steps performed, etc. and found that this loss of permissions occurs when ABS shuts down the TestComplete script.



    ABS -

    1. Run Submacro 'StartVM' using PowerCLI script

    2. Starts and runs TestComplete macro on the VM

    3. Stops TestComplete/TestExecute on the VM after last macro step

    4. Run Submacro 'StopVM' using PowerCLI script

    5. Stops ABS macro



    By continually attempting to access the folder I found that it locks at Step 3. I disabled Step 4 to rule out the PowerCLI script. The padlock appears on the folder icon as the TestComplete 10 Log appears on the VM, indicating that the TestComplete test has, well, completed, and before ABS completes the run.



    Edit: Attached screenshot of the error displayed when I attempt to take ownership and restore permission accounts.