dmcgannon Posted October 22, 2020 Share Posted October 22, 2020 I have checked everywhere and keep falling short. I have an application that will only run correctly under an admin account, standard users are not able to run it. When I enter in the local credentials, it won't compile, keeps giving me error code 1. RunAsWait("localadmin", "@ComputerName", "$Password", 1, "C:\Program Files(x86)\Speco Technologies\SpecoTech Multi Client\SpecoMC.exe" ) I have tried runas, runaswait and I am still unsuccessful. Any ideas would be greatly appreciated. Link to comment Share on other sites More sharing options...
TheXman Posted October 22, 2020 Share Posted October 22, 2020 (edited) 14 minutes ago, dmcgannon said: RunAsWait("localadmin", "@ComputerName", "$Password", 1, "C:\Program Files(x86)\Speco Technologies\SpecoTech Multi Client\SpecoMC.exe" ) Do you pass the password in the variable $Password? If so, why do you have it in quotes? Having it in quotes says to pass the literal "$Password" not the value in the variable. The same is true for the @ComputerName macro. Look at the RunAsWait example in the help file. Do you see quotes around @ComputerName or $Password in the example? You have a local admin account named "localadmin" on the workstation? Edited October 22, 2020 by TheXman CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman Link to comment Share on other sites More sharing options...
dmcgannon Posted October 22, 2020 Author Share Posted October 22, 2020 I looked at the examples and honestly, I had a script that I used before in Windows 7 that worked correctly for a particular application. I tried to change the values for Windows 10 with different application and no success. Of course that same script hasn't wanted to work since we upgraded to 10 either.... Link to comment Share on other sites More sharing options...
dmcgannon Posted October 22, 2020 Author Share Posted October 22, 2020 You seem pretty proficient with AutoIt. I've written a few scripts but am having trouble getting this one to work correctly. I haven't had issues in the past, but we've never been able to get these scripts to work on Windows 10 correctly. I have an application that only appears to run correctly is the user is an admin. This is my code for it and the variables are defined, but when I try to compile, it gives me error code 1. $Password= Your Local Password $Username= localadmin RunAsWait($Username, @ComputerName, $Password , 0, "C:\Program Files(x86)\Speco Technologies\SpecoTech Multi Client\SpecoMC.exe" Link to comment Share on other sites More sharing options...
Nine Posted October 22, 2020 Share Posted October 22, 2020 That can't be right ! You are missing quotes around the 2 strings (un/pw). And are you sure there is a "localadmin" user ? “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...
dmcgannon Posted October 22, 2020 Author Share Posted October 22, 2020 Yes, we actually have disabled the administrator account due to security concerns and have another admin account defined as localadmin. If I put quotes around the strings, I still can't get it to compile. Link to comment Share on other sites More sharing options...
Nine Posted October 22, 2020 Share Posted October 22, 2020 what is the message you receive when you run it from scite ? “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...
dmcgannon Posted October 22, 2020 Author Share Posted October 22, 2020 When I try to comiple, I get exit code: 1 Time: 1.994 Link to comment Share on other sites More sharing options...
dmcgannon Posted October 22, 2020 Author Share Posted October 22, 2020 Now I don't have the application on my machine that I'm trying to compile the code to run, but it shouldn't matter... should it? Link to comment Share on other sites More sharing options...
Nine Posted October 22, 2020 Share Posted October 22, 2020 Try running your code in SCITE first ! “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...
dmcgannon Posted October 22, 2020 Author Share Posted October 22, 2020 Test Run still gives me error code 1....... Link to comment Share on other sites More sharing options...
dmcgannon Posted October 22, 2020 Author Share Posted October 22, 2020 Sorry.. It says exit code of 1 Link to comment Share on other sites More sharing options...
Nine Posted October 22, 2020 Share Posted October 22, 2020 Try running notepad instead, to see if the RunAsWait is working correctly with your parameters... “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...
dmcgannon Posted October 22, 2020 Author Share Posted October 22, 2020 Hmmm.. notepad even gives me the exit code of 1.... Link to comment Share on other sites More sharing options...
dmcgannon Posted October 22, 2020 Author Share Posted October 22, 2020 I know the values are correct..... Link to comment Share on other sites More sharing options...
Nine Posted October 22, 2020 Share Posted October 22, 2020 Post your code with notepad, I'll test it with another admin user on my comp. “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...
dmcgannon Posted October 22, 2020 Author Share Posted October 22, 2020 ; Set the RunAs parameters to use local adminstrator account RunAsWait("admin", @ComputerName, "EnterPassword", 0, "%windir%\system32\notepad.exe" Sorry... obviously admin is whatever admin user is and then put in the password. Link to comment Share on other sites More sharing options...
Nine Posted October 22, 2020 Share Posted October 22, 2020 There is a missing right parenthesis ! And %windir% won't work unless you have the right opt ("ExpandEnvStrings", 1) or use macro @WindowsDir “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...
dmcgannon Posted October 22, 2020 Author Share Posted October 22, 2020 Sorry.. my code actually has the closed parentheses as well. But I'm still getting an error code of 1... Link to comment Share on other sites More sharing options...
Nine Posted October 22, 2020 Share Posted October 22, 2020 Did you modify the run line as I suggested in the second part of my last post ??? “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...
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