Jump to content

RunAs


Recommended Posts

2 hours ago, dmcgannon said:

Actually changed the %windir% to C:\Windows\notepad.exe... I think that's the right path for the notepad app.

 

53 minutes ago, Nine said:

nope, check again...

 

Perhaps not really relevant to this thread but a Windows Explorer search for "notepad.exe" in my Windows 7 - 64bit system finds no less than SEVEN individual copies of notepad.exe. One of them is in fact in C:\Windows and %windir% = "C:\Windows".

Phil Seakins

Link to comment
Share on other sites

just a guess: it's worth trying to add these few lines to the beginning of the script and try again one more time. Let us know...

#include <WinAPIFiles.au3>
;Turn off redirection for a 32-bit script on 64-bit system.
If @OSArch = "X64" And Not @AutoItX64 Then _WinAPI_Wow64EnableWow64FsRedirection(False)

 

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Link to comment
Share on other sites

#include <WinAPIFiles.au3>
;Turn off redirection for a 32-bit script on 64-bit system.
If @OSArch = "X64" And Not @AutoItX64 Then _WinAPI_Wow64EnableWow64FsRedirection(False)
RunAsWait("localadmin", @ComputerName, "your admin password here" , 1, "C:\Program Files\HandBrake\HandBrake.exe")

I've tried 0 , 1.. not sure what I should be using there honestly.

Edited by dmcgannon
Link to comment
Share on other sites

Okay... I've tried playing with the scripts and here's my latest code, that is an admin user account that has been created specific to this function. Also the correct path for the application.... I've tried my code with notepad and it launched perfectly. When I try this application, a command window pops up, then closes and nothing seems to happen.
RunAsWait("SpecoTec","Oburgcounty","Password Here", 0, "C:\Program Files (x86)\Speco Technologies\SpecoTech Multi Client\SpecoMC.exe")

Link to comment
Share on other sites

Link to comment
Share on other sites

Bro help us to help you. 

Answer on the correct way : Post always the code you are using.... (Always

In this kind of tag Thanks :)

From what I understand there is misunderstanding of what you want to do and what you are using. 

Try that and replace with "C:\Program Files (x86)\Speco Technologies\SpecoTech Multi Client\SpecoMC.exe": 

Local $sFile = "C:\Windows\notepad.exe"
Local $iPID  = ShellExecute($sFile)

These lines : 

Local $sFile = "C:\Program Files (x86)\Speco Technologies\SpecoTech Multi Client\SpecoMC.exe"
Local $iPID  = ShellExecute($sFile)

-You determine your app first. 

-You lunch the app. 

And then in this case if you need admin right in the computer that run the script. To Execute the application under the admin account. 

Then : 

#RequireAdmin
    
Local $sFile = "C:\Program Files (x86)\Speco Technologies\SpecoTech Multi Client\SpecoMC.exe"
Local $iPID  = ShellExecute($sFile)

 

Edited by caramen

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

@dmcgannon

Have you figured out why you are getting the @error = 1?  If not, I'm sure I can help you get past it so you can continue to make progress.

Link to comment
Share on other sites

frustration gifs Page 9 | WiffleGifNever Give Up GIFs - Get the best GIF on GIPHY

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...