scarr Posted August 30, 2019 Share Posted August 30, 2019 Hello! I have a script that makes a directory, copies a file locally from a server, and executes it. I know the file gets there and executes but then I get the UAC prompt. When I put #RequireAdmin at the top of my script, the file doesn't even get to the directory. I was hoping someone could help since I am new to this. Does anyone know what is going on? Link to comment Share on other sites More sharing options...
Developers Jos Posted August 30, 2019 Developers Share Posted August 30, 2019 Moved to the appropriate forum, as the Developer General Discussion forum very clearly states: Quote General development and scripting discussions. If it's super geeky and you don't know where to put it - it's probably here. Do not create AutoIt-related topics here, use the AutoIt General Help and Support or AutoIt Technical Discussion forums. Moderation Team 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...
Nine Posted August 30, 2019 Share Posted August 30, 2019 Post your code so we can see what is wrong. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
scarr Posted August 30, 2019 Author Share Posted August 30, 2019 #RequireAdmin #include <FileConstants.au3> #include <MsgBoxConstants.au3> #include <WinAPIFiles.au3> ;Variables Local Const $fpath="C:\bomgar" Local Const $bomsource32="G:\Bomgar\Workstations\32-bit" Local Const $bomsource64="G:\Bomgar\Workstations\64-bit\bomgar.exe" Local Const $bomfile64="C:\bomgar\bomgar.exe" ;Create path and copy file to path DirCreate($fpath) FileCopy($bomsource64, $fpath, 1) Run($bomfile64) ;UAC on .exe So here it is. Like I mentioned, it copies over and must execute because I get the AUC prompt on the .exe when I don't have #RequireAdmin. Thank you. Link to comment Share on other sites More sharing options...
Developers Jos Posted August 30, 2019 Developers Share Posted August 30, 2019 Try first using the UNC path, in stead of the mapped drive, to the sourcefile when running elevated. Jos 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...
Nine Posted August 30, 2019 Share Posted August 30, 2019 Check for errors at all steps (using ConsoleWrite), and verify Scite console for any messages... “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
scarr Posted September 3, 2019 Author Share Posted September 3, 2019 Using the UNC path for the network location variables totally worked! Thank you Jos. 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