Script Error in PDQ Deploy - Runs fine locally
I am trying to run a command that deletes folders that start with CefSharp* through PDQ Deploy on a computer and it keeps failing with the following error: LOCALAPPDATA~G" was unexpected at this time.
for /d %G in ("%LOCALAPPDATA%\Temp\CefSharp*") do rd /s /q "%~G"
When I run the above command on the computer in command prompt it works and deletes all the folders in the current user's appdata\local\temp folder that start with CefSharp.
What am I missing?
1
Comments
Deploy executes Command steps as a batch file, so variables need 2 % symbols: https://ss64.com/nt/for.html
This PowerShell code should do the same thing:
Well *$#^ that worked beautifully! Thanks, man!