Razorblade1979 Posted July 4, 2013 Share Posted July 4, 2013 I am new to this forum Fist I tried making some simple batch scripts but I had a big problem: copying files to for example C:Program files because of admin rights(runned as administartor etc output was acces denied When I write something simular in autoIT will this solve my problem Hope some of you guys can help me out searched everywhere Greetings Razorblade Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 4, 2013 Moderators Share Posted July 4, 2013 Razorblade1979,Welcome to the AutoIt forum. Look at #RequireAdmin in the Help file - that will run the script with Admin rights and should solve your problem, although you will still have to enter the Admin credentials as the script starts. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
CountyIT Posted July 17, 2013 Share Posted July 17, 2013 Hmmm.... my #requireadmin seems to have worked quite well until today. I tried it on a friends W7 64-bit and when not an administrator the mouse cursor just spun and the computer got really messed up. Couldn't close Windows or anything. I then fired up my Windows 7 64-bit laptop and got the same results. I know it use to work. It use to pop up and ask for credentials but then I started thinking about it. I don't think I ever ran the script under 64-bit WIndows. If you look at the help file for #requireadmin it states it is for Windows 2000, XP and Vista. It does not mention Windows 7 or WIndows 8 let alone 64-bit. Is #requireadmin Windows 7 and Windows 8 compatible? 32 and 64-bit? I started look for alternatives and found IsAdmin() but the help file is a little lacking on it too. Does IsAdmin() with Windows 7 and 8 both 32 abd 64 bit? Link to comment Share on other sites More sharing options...
0xdefea7 Posted July 17, 2013 Share Posted July 17, 2013 #RequireAdmin works perfectly fine on all version of Windows. Even Windows Blue (8.1). Link to comment Share on other sites More sharing options...
BrewManNH Posted July 17, 2013 Share Posted July 17, 2013 There was a trak ticket #1498 regarding this, if the UAC is turned off on the system. 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 Link to comment Share on other sites More sharing options...
CountyIT Posted July 17, 2013 Share Posted July 17, 2013 Hmm... I am almost going to have to disagree. I use the #RequireAdmin on a install program. As mentioned above I tried installing on a customer's Windows 7 64-bit computer this morning and when I ran the script all it did was circle the mouse cursor and virtually hang the computer. I then ran it on my Windows 7 64-bit. It ran fine but I am an administrator. I created a normal user, logged in as that normal user, and got the same results as on my customer's. Spinning mouse cursor and things were hung up. The strange part is I swear it use to work. That it use to pop up and ask for credentials if you weren't an administrator. Have you tried it recently? Do you know what might have changes? Along the same line: If IsAdmin() = 1 Then MsgBox(0, "", "You are an admin") Else MsgBox(0, "", "You aren't an admin") EndIf Seems to work find on XP and both Windows 7 32 abd 64 but not on Windows 8..... Link to comment Share on other sites More sharing options...
BrewManNH Posted July 17, 2013 Share Posted July 17, 2013 Disagree with who, and in regards to what? 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 Link to comment Share on other sites More sharing options...
JohnOne Posted July 17, 2013 Share Posted July 17, 2013 #RequireAdmin does not give you admin privileges. And if you are not promted to to allow adin then UAC is turned off (see post >#6) AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
CountyIT Posted July 17, 2013 Share Posted July 17, 2013 Disagree with 0xdefea7. But... not totally disagree. It works with all versions of Windows as long as UAC is enabled. You nailed it BrewManNH. That is "what has changed". I disabled UAC and logging in as a normal user sends the script in to la la land. I guess in my case IsAdmin() would work better because is doesn't seem to rely on UAC and if they aren't an administrator I simply want to quit the script. Link to comment Share on other sites More sharing options...
BrewManNH Posted July 17, 2013 Share Posted July 17, 2013 I guess in my case IsAdmin() would work better because is doesn't seem to rely on UAC and if they aren't an administrator I simply want to quit the script. That would be the best route to go, because as JohnOne said, using it doesn't give you the rights to run it, it just asks you for them. 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 Link to comment Share on other sites More sharing options...
0xdefea7 Posted July 17, 2013 Share Posted July 17, 2013 I still don't see how you can disagree with me at all. The issue was not with the function, it was with your environment. The function works as expected, on all versions of Windows. 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