Epulone Posted January 7, 2018 Posted January 7, 2018 There is a way to run a compiled script as an administrator in a user account? Thanks
Developers Jos Posted January 7, 2018 Developers Posted January 7, 2018 Not sure what you are asking. Yes you can enforce a script to be ran as Administrator with #RequireAdmin, but that will trigger UAC in case it isn't running at that level yet, unless UAC is disabled. Jos PramodR 1 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.
Epulone Posted January 7, 2018 Author Posted January 7, 2018 Yes Jos I was wondering if I could run the program with #RequireAdmin --> as a normal user. So if I understood well using #RequireAdmin in the script will give to the executable file (after compiled) the elevated rights of the SYSTEM account? In this scenario if the UAC is disabled any user can install the program, isn't it? Thanks
jguinch Posted January 7, 2018 Posted January 7, 2018 If the UAC is disabled, the #RequireAdmin directive is useless. A standard user cannot install a program directly (a program witch needs admin rights). It's possible to use the Run as different user option with an admin user (RunAs function). Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF
Juvigy Posted January 9, 2018 Posted January 9, 2018 You want to RUN a program with admin rights , without having admin rights Or runas admin rights. So i guess you want to 'attach' to the system account for some reason. This is suspicious behavior. Why would you need that ?
Earthshine Posted January 9, 2018 Posted January 9, 2018 well you can run it like that, and it will prompt you for admin access, like you know, a password My resources are limited. You must ask the right questions
Epulone Posted January 13, 2018 Author Posted January 13, 2018 (edited) Thank you all. The reason I need this option is beacuse I am managing a PCs LAB used for students to practice various projects and computing studies. If for example the students need to pratice with network adapter changing the IP address from automatic to static they need Admin right to do it. This seems the only way for them to do some actions without having admin right. In this scenario could I use RunAs to execute an .exe or script from a standard user? So if i use RunAS as below I should solve my problem? RunAs(LocalAdmin, @ComputerName, Passw0rd,1, ' C:\folder\program.exe') Thanks Edited January 13, 2018 by Epulone
Earthshine Posted January 13, 2018 Posted January 13, 2018 They should be running in VM My resources are limited. You must ask the right questions
Epulone Posted January 13, 2018 Author Posted January 13, 2018 I suggested this options to the lecturer using the "bridge" option in VM workstation but I was told it was not functional for the module he want to teach one because VM is not part of the lessions second because he wish the student act directly on the machines as for example with a cossover cable to joint two PCs.
Juvigy Posted January 15, 2018 Posted January 15, 2018 On 1/13/2018 at 4:07 PM, Epulone said: So if i use RunAS as below I should solve my problem? RunAs(LocalAdmin, @ComputerName, Passw0rd,1, ' C:\folder\program.exe') Yes.
BrewManNH Posted January 16, 2018 Posted January 16, 2018 You're just going about this totally wrong, these computers shouldn't be on the schools network they should be isolated to their own network, then give the students admin access to the computers. This way if they try to do something malicious they won't affect the school's network. Doing it any other way is just going to be a huge disaster waiting to happen. Draygoes and Earthshine 2 If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator
Earthshine Posted January 16, 2018 Posted January 16, 2018 (edited) yep. grade A disaster waiting to happen. could not be more wrong of a solution! good luck. Set up VMWare VMs for them to play in on their own network Edited January 16, 2018 by Earthshine Draygoes 1 My resources are limited. You must ask the right questions
shmuelw1 Posted March 13, 2018 Posted March 13, 2018 (edited) Quote If the UAC is disabled, the #RequireAdmin directive is useless. I have UAC disabled and I just fixed a script that would not work by adding #RequireAdmin. So it's worth a try. Edited March 13, 2018 by shmuelw1
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