Passing variables in script modules


  • Hello. Attempting to use the %username% variable in a script module with no success.

    cd\
    xcopy C:\ApplyThese\start2.bin "C:\Users\%username%\AppData\Local\Packages\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\LocalState" /D /C /Y
    

    However, it works fine if I specify the exact path. Is there a workaround or setting I'm missing? Thanks.

    cd\
    xcopy C:\ApplyThese\start2.bin "C:\Users\administrator\AppData\Local\Packages\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\LocalState" /D /C /Y
    

  • Script module runs as the system account, there wouldn't be a %username% variable because no user is logged in.