12321 Posted June 10, 2015 Share Posted June 10, 2015 Hi,is there a possibility to run a script from the SYSTEM account and show a window or a GUI in another account?To give an example if I run the following script from the USERTEST account, then I see the notepad window.RunAs(USERTEST, @ComputerName, USERPWTEST, 0, "notepad.exe", "", @SW_SHOWMAXIMIZED)But if I run it from the SYSTEM account, and I am logged in as USERTEST then I don't see the notepad window. I only see a process notepad.exe run as USERTEST but no visible window.(This is obviously only a very simple example for my problem, for my script I want to start the script really as the SYSTEM account but have something visible for the logged in user.) Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted June 10, 2015 Moderators Share Posted June 10, 2015 If I need to run as System, I often do a fileinstall of PSEXEC, and throw it in the temp directory on the machine. PSEXEC has an option to run as system but interact with the desktop of the currently logged in user. 12321 1 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
12321 Posted June 10, 2015 Author Share Posted June 10, 2015 (edited) First time I work with the SYSTEM account... So RunAs under the SYSTEM account is not able to interact with the desktop of the currently logged in user? Under no circumstances?Thanks, for suggesting PSEXEC. I somehow thought that I would be able to have everything in one exe (Well but fileinstall is a nice workaround then). But seems that I have to use PSEXEC. Edited June 10, 2015 by 12321 Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted June 10, 2015 Moderators Share Posted June 10, 2015 If I remember correctly, psexec creates a hidden service, which is the only way to get something to run as SYSTEM. You cannot just do a RunAs. If I am incorrect, I am sure someone will wander by and tell me so 12321 1 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
12321 Posted June 10, 2015 Author Share Posted June 10, 2015 Thanks for your reply Will try it with PSEXEC and fileinstall now. Link to comment Share on other sites More sharing options...
12321 Posted June 10, 2015 Author Share Posted June 10, 2015 (edited) When I use following code and run it under the system account:Run("PsExec.exe -s -accepteula -u USERTEST -p USERPWTEST -i notepad.exe")Then it is still very 'user friendly', because following message pops up: I know it's a security measure... But is there any way around it? Edited June 10, 2015 by 12321 Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted June 10, 2015 Moderators Share Posted June 10, 2015 What do you get when you click the Why does this happen link?(Hint: Yes there is something you can do, and that link - along with Google - will show you) "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now