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.

Can you use %username% variable and others in pdq deploy



I wanted to create a file copy program to a server \\server\share\loggedonusername

I can use these variables in a cmd script, but not in the file copy step.

Is this possible, or is it possible to create a PDQ deploy Variable for this?





Date Votes
  • Yes, you can use %userprofile% variable for current logged on user.


  • Yes, but when I try to use this in a File Copy Step, I get a warning that the folder can't be found.

    In the CMD it works fine.

  • This kind of task can be used ONLY while a user is logging in (or is already logged in). The %USERPROFILE% variable is set dynamically PER USER. What that means is, that if you do a deployment as domain\joe, the pdqdeployservice runs under this user name and the %userprofile% variable is set to Joes profile - i.e. C:\Users\joe

  • I know, and that's how we want it to act. But when I use the file copy step with the variable, it gives an error.

    when I use a parameter in a cmd, it works

  • In your screenshot you selected the copy operation of a file, but you did not specify the file name. I think you should pecify it as a folder.

  • Correct, but it stays the same error ;-) --> Directory not found.

  • Hi Pepijn,

    I know this comes late, but if weren't able to resolve this, one thing you might want to try is to run the deployment as local logged on user. Please see the attached screenshot for an example.

    This means that if domain\joe is logged in to the machine, %username% would then resolve to joe and your command is more likely to succeed.

  • Thanks,

    I was indeed able to do this via logged on user.