locked
App-V 5 variable to get Get current username RRS feed

  • Question

  • Hi,

    I don't find the variable in app-v 5 to get the current username and we have [{AppVCurrentUserSID}] is used to get the current user SID.

    Appreciate any help and do we have any work around?

    Thanks

    Thursday, December 15, 2016 11:44 AM

Answers

  • As I said there is no Appv5 Token for the username :).
    Instead of pointing to the exe directly, you could create vbs to start it for you, like:

    Set objShell = WScript.CreateObject("WScript.Shell")
    strUser = CreateObject("WScript.Network").UserName
    objShell.Run """C:\Program Files (x86)\Microsoft Office\Office16\MSACCESS.EXE"" ""\\test03\app1\Users\"+strUser+"\access\test.accde""", 1, False
    Set objShell = Nothing


    Roy Essers

    Thursday, December 15, 2016 7:00 PM

All replies

  • There is no token for the current username. Why do you need one? You could use %username%

    Roy Essers

    Thursday, December 15, 2016 12:52 PM
  • I have requirement to create the shortcut to launch the MS Access file from userprofile on network path but I don't find the App-V 5 variable to get the username used %username% in the below shortcut path. It was not working for me when used %username% variable
     
    I know the variable to get SID for USER but not find the app-v 5 variable for username
     
    Shortcutpath:
     

    "C:\Program Files (x86)\Microsoft Office\Office16\MSACCESS.EXE" "\\test03\app1\Users\%username%\access\test.accde"

    Any work around?

    Thursday, December 15, 2016 1:52 PM
  • As I said there is no Appv5 Token for the username :).
    Instead of pointing to the exe directly, you could create vbs to start it for you, like:

    Set objShell = WScript.CreateObject("WScript.Shell")
    strUser = CreateObject("WScript.Network").UserName
    objShell.Run """C:\Program Files (x86)\Microsoft Office\Office16\MSACCESS.EXE"" ""\\test03\app1\Users\"+strUser+"\access\test.accde""", 1, False
    Set objShell = Nothing


    Roy Essers

    Thursday, December 15, 2016 7:00 PM