Jump to content

Delete Files Older Than x Days - ForFiles.exe - Script Issues


Recommended Posts

  • 3 months later...
Posted
sorry to dig up old post but when i tried the powershell script above the powershell cmd says the execution of scripts is disabled on this system. what do I need to set first before running the script?
Posted
sorry to dig up old post but when i tried the powershell script above the powershell cmd says the execution of scripts is disabled on this system. what do I need to set first before running the script?

 

Normally I find UAC is fussy with scripts, on remote shares. (As there's no "run as admin" like on exe's). If you move it to C:\ does it work?

 

Or if it normally works just not with powershell check your execution policy default is powershell scripts can't run, but cmdlets can. (Restricted level)

 

Steve

  • Thanks 1
Posted

Hello, i was testing the script on my windows 7 machine. I disabled UAC and rebooted. Additionally i ended up seting the execution policy to unrestricted. it all works fine now.

 

Cheers

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...