"Run As ..." incorrectly creates user environment

The C # application crashes under some circumstances when launched with a user who is not an administrator.

I am having a problem with Windows Server 2003 and am trying to find more information about this. This may be a problem for other Windows operating systems.

It seems that if I create a non-administrator user and then run the application under that user using the “Run as” command, the user environment will not be configured correctly, and the TEMP environment variable points to C: \ Windows \ Temp instead of users, having their own Temp folder in the Documents and Settings profile. The user does not have permissions for this folder, so the application crashes with the .Net JIT compiler trying to write / read to this folder.

If I log in as this user, the situation is still not correct. I do not get the environment to be prepared for what you usually get when you log in with a new user, and my application will still not work without failures during startup. Infact I realized that the user cannot run calc.exe or other programs in the Windows folder. It seems that their environment is constantly confused, and I think the only way forward is to delete their profile.

If I create a user who is not an administrator and log in as he before doing “Run as ..”, the environment will be configured normally and my application will work.

I cannot find any information about this issue or notes on whether Microsoft recognizes it. Have you experienced this, or know where I can find, to find more about it?

+3
1

runas , .

C:\temp>runas RUNAS USAGE:

RUNAS [ [/noprofile | /profile] [/env] [/netonly] ]
        /user: program

RUNAS [ [/noprofile | /profile] [/env] [/netonly] ]
        /smartcard [/user:] program

/noprofile , .                       , ,                       .
/profile , .                       . /env , . /netonly,                       . /savecred .                       Windows XP Home                       . /smartcard,                       ./ USER @DOMAIN DOMAIN\USER
EXE.

:

runas /noprofile /user:mymachine\administrator cmd  runas /profile /env /user:mydomain\admin "mmc %windir%\system32\dsa.msc"  runas /env /user:user@domain.microsoft.com "notepad \"my file.txt\""

. , . . USER @DOMAIN /netonly. : / /Netonly.

+3

Source: https://habr.com/ru/post/1698401/


All Articles