Important Notice: On February 29th, this community was put into read-only mode. All existing posts will remain but customers are unable to add new posts or comment on existing. Please feel to join our Community Discord for any questions and discussions.

How can I run this as a command file in PDQ deploy?

I have the following command which works fine via the command line, but won't work with PDQ deploy.  I think it's more of a escaping special characters issue so that PDQ deploy can run it, or maybe I should use something like 'psexec' to do this.  I just want to run this from the command line:

for /d  %d  in ("c:\users\*") do rd /s/q "%d\AppData\LocalLow\Sun\Java\Deployment\cache"
0

Comments

3 comments
Date Votes
  • Put the command in to a batch file and deploy that.

    I am not sure if PDQ Deploy can handle variable expansion.

    0
  • You nailed it, Bruce. You need to escape the special characters (in this case %) like you would in a batch file. PDQ Deploy  (2.3 and later) processes Command Steps into batch files. Try this command:

    for /d  %%d  in ("c:\users\*") do rd /s/q "%%d\AppData\LocalLow\Sun\Java\Deployment\cache"

    There are a few gotchas running batch files vs. commands in cmd.exe. Here is a great cheat sheet for escaping special characters in batch files.

     

    0
  • Nice!  It worked.  Many thanks,

    Bruce

     

    0