kater Posted September 6, 2007 Share Posted September 6, 2007 Hi Guy's Small questionHow to can I apply my script by Administrator ?The normal user can not change any thing in his profile because he do not have permissions to change any thingand my script will change some thing and i can not give the normal user the password of administrator to change some thing in his profileI want to install program in this PC and I want to run it by administrator as you sowing in the below How to can I apply my script by Administrator ? I thing my idea is very clear Reg's Link to comment Share on other sites More sharing options...
Xenobiologist Posted September 6, 2007 Share Posted September 6, 2007 Hi, RunAsSet So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
kater Posted September 6, 2007 Author Share Posted September 6, 2007 Can you please explain to me more and give me example for that I wating you !! Link to comment Share on other sites More sharing options...
Developers Jos Posted September 6, 2007 Developers Share Posted September 6, 2007 Can you please explain to me more and give me example for that I wating you !! Have you looked in the helpfile for it ? SciTE4AutoIt3 Full installer Download page  - Beta files    Read before posting   How to post scriptsource   Forum etiquette Forum Rules  Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
kater Posted September 6, 2007 Author Share Posted September 6, 2007 Frankly, No But tell me or give me first code and I'll complete every thing with my self Link to comment Share on other sites More sharing options...
Developers Jos Posted September 6, 2007 Developers Share Posted September 6, 2007 Frankly, No But tell me or give me first code and I'll complete every thing with my self tuurlijk... kijk toch maar even zelf .... SciTE4AutoIt3 Full installer Download page  - Beta files    Read before posting   How to post scriptsource   Forum etiquette Forum Rules  Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
bobetko Posted September 7, 2007 Share Posted September 7, 2007 Cmon... We would be offended if you did not look into the helpfile that we have so arduously crafted.LAr.I've looked at help file and it seems to me that RunAsSet not works as supposed...for example:FileExists("\\share\1\somefolder\file.bat") is telling me that file exists.If I do Run("\\share\1\somefolder\file.bat"), then I get error message that path cannot be found.Something is fishy here. Link to comment Share on other sites More sharing options...
Developers Jos Posted September 7, 2007 Developers Share Posted September 7, 2007 I've looked at help file and it seems to me that RunAsSet not works as supposed...for example:FileExists("\\share\1\somefolder\file.bat") is telling me that file exists.If I do Run("\\share\1\somefolder\file.bat"), then I get error message that path cannot be found.Something is fishy here.Assume you also have RunAsSet() in this script ?FileExists() runs under the original credentials and Run() uses the RunAsSet() Credentials ... does that explain what you are seeing ? SciTE4AutoIt3 Full installer Download page  - Beta files    Read before posting   How to post scriptsource   Forum etiquette Forum Rules  Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
kater Posted September 8, 2007 Author Share Posted September 8, 2007 No body wants to help me fyi : I'm new in this application , I want to learn it Link to comment Share on other sites More sharing options...
Developers Jos Posted September 8, 2007 Developers Share Posted September 8, 2007 (edited) No body wants to help me fyi : I'm new in this application , I want to learn itDont think you replied to my post or do you want us to perform miracles for you ? Edited September 9, 2007 by JdeB SciTE4AutoIt3 Full installer Download page  - Beta files    Read before posting   How to post scriptsource   Forum etiquette Forum Rules  Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
kater Posted September 9, 2007 Author Share Posted September 9, 2007 (edited) you are a miracle that's why I asked you Can you please give me a first step Edited January 20, 2008 by kater Link to comment Share on other sites More sharing options...
SkinnyWhiteGuy Posted September 9, 2007 Share Posted September 9, 2007 Hopefully to prevent JdeB from blowing another gasket (I nearly fell over laughing at that) I'll try to help explain: Using RunAsSet is almost like logging out and logging in as that user, accept without all the logging out and in stuff. So, when you change who the script is run as, the new user who the script is running as has no network volumes mounted, and no rights to shares either. So, after using RunAsSet, you basically need to reconnect to whatever network volume you were running from before. To test for this, as in your example above, test if FileExists both before and after you use RunAsSet, just to see that that is causing the file to disappear. Link to comment Share on other sites More sharing options...
Tiger Posted September 9, 2007 Share Posted September 9, 2007 Example from the helpfile: ; This example will rerun itself with admin rights on using a local account ; Note on Vista this may not work as even though the user is admin it may ; not be elevated even after the RunAs call. In that case use #RequireAdmin ; at the top of the script. ; Are we already admin? If Not IsAdmin() Then RunAsSet('USER', @Computername, 'PASSWORD') Run('"' & @AutoItExe & '"' & ' "' & @ScriptFullPath & '"', @WorkingDir) Exit EndIf MsgBox(0, 'Message', 'Now running with admin rights.') My UDFs:- _RegEnumKey Link to comment Share on other sites More sharing options...
kater Posted September 9, 2007 Author Share Posted September 9, 2007 (edited) Tiger thanks for your help ========================= I tried to modify in the existing code ,but I faced some errors can you please explain more to meI want to run this application mspaint.exe by admin user " Run as "The user name is : AdminPassword is : 12345678how to can I define that in the code Edited September 9, 2007 by kater 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