Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


Joey S
2020-02-20T16:07:18Z
I have the following PowerShell script running on two different servers, one running VC v8.5.5 and the other v9.1.0.
Remove-Item -Recurse -Force "c:\Restore\Drive(C)"
Remove-Item -Recurse -Force "c:\Restore\Drive(D)"
Remove-Item -Recurse -Force "E:\Filesets\PL595A"
Remove-Item -Recurse -Force "E:\Filesets\PL595M"
Remove-Item -Recurse -Force "F:\OT570FSETA"

On the 8.5 machine the script works and the folders are deleted. On the 9.1.0 machine, the task runs for a few seconds and then provides an Exit Code of 255. I looked this up in the VC exit codes (https://www.visualcron.com/exitcodes.aspx) and it shows "255 The extended attributes are inconsistent."

What does this mean and what can I do to get this to work?

If I run the script in PS (not using VC) it still works on that machine. It just does not want to work through VC
Sponsor
Forum information
Joey S
2020-02-20T20:31:37Z
I found that I can use this instead:
$fso = New-Object -ComObject scripting.filesystemobject
$fso.DeleteFolder("E:\Filesets\PL595A")
$fso.DeleteFolder("E:\Filesets\PL595M")
$fso.DeleteFolder("c:\Restore\Drive(C")
$fso.DeleteFolder("c:\Restore\Drive(D)")
$fso.DeleteFolder("F:\OT570FSETA")

Still weird why the "old" way does not work. I assume your version of PS changed somehow...?
Support
2020-02-21T13:49:14Z
Yes, I think the Powershell version was updatead. Thank you for the feedback!
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Joey S
2020-03-09T14:20:46Z
I guess I am having issues still. I tried v9.1.5 and still no go. The issue is with Read Only attribute files. Neither powershell, execute using cmd prompt or the "Delete Folder" task, with or without Admin credentials being used will delete the folder.

I can delete the folder in a windows session using an admin account AND I can manually run a powershell session using my command and all manual methods will delete the file so it is not a permission issue, in general but rather an issue with the creds not passing through VC to get the job done
bweston
2020-03-17T18:21:30Z
Have you tried different combinations of "Local Login" and "Load Profile?" I believe in updating from 8.5.5 to 9.1.5 I encountered a few things that required different combinations of those flags from what I'd used before. I should have kept a more careful list. I was somewhat distracted because of an issue I ran into with variable name casing. Come to think of it, I should report that in its own thread.
Joey S
2020-03-17T18:41:35Z
I did try combinations of those, thanks for suggesting

Here is all that I tried (and what I ended on)
- my "old" powershell script (example: Remove-Item –path c:\testfolder\ remove-item * )
+ I tried that using no credentials, credentials only, login only and load profile - none of them worked - the users in question are admins and logging in as those users I can manually delete and change folders without error
- tried a new script (file system object) (example $fso = New-Object -ComObject scripting.filesystemobject, $fso.DeleteFolder(“C:\test*”)
+ again, all credential variations without success
- I tried the builtin "delete folders" visualcron task
- I tried command line "rm" commands
+ again, all variations of creds
I settled on a simple rmdir batch script and am running it without credentials
rd E:\Filesets\PL595A /S /Q
The only issue with this is that I get no Std Out so my job report does not show information on that task other than it was successful in running in x amount of time.

To that end, the powershell command didn't give great output either so, I am just going to use this from now on. It is fine I guess


Scroll to Top