Jump to content

%username% returning NULL


Recommended Posts

I'm running a simple script with CMAK (Connection Manager Administration Kit) to check/make a registery change pre-connection, but during runtime %username% returns as NULL

%systemroot%\system32\cscript.exe "%systemdrive%\documents and settings\%username%\Application Data\Microsoft\Network\connections\cm\rdrukvpn\vpn_reg.vbs"

ERROR MESSAGE

"C:\documents and settings\NULL\Application Data\Microsoft\Network\connections\cm\rdrukvpn\kb311218.vbs" Was not found

When i manually run this script within a DOS prompt or from RUN, its fine. Also it makes not difference whether its run as a cscript or wscript, still the same error.

any one know why it would return NULL?

Thanks

Link to comment
Share on other sites


\%username% i think need that %UserProfile%

I'm running a simple script with CMAK (Connection Manager Administration Kit) to check/make a registery change pre-connection, but during runtime %username% returns as NULL

%systemroot%\system32\cscript.exe "%systemdrive%\documents and settings\%username%\Application Data\Microsoft\Network\connections\cm\rdrukvpn\vpn_reg.vbs"

ERROR MESSAGE

"C:\documents and settings\NULL\Application Data\Microsoft\Network\connections\cm\rdrukvpn\kb311218.vbs" Was not found

When i manually run this script within a DOS prompt or from RUN, its fine. Also it makes not difference whether its run as a cscript or wscript, still the same error.

any one know why it would return NULL?

Thanks

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...