Welcome to the community forums for Theopenem. All responses are provided by other users that wish to help out. Theopenem will not respond to these posts. If you require more assistance than what the community can provide, we offer various paid support options.

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.