Jump to content

requireadmin script will not run


Recommended Posts

Hi all,

I have a script that updates a program across on many computers company wide. Occasionally it needs to  install updates of other programs but sometimes it definitely doesn't want to have administrator privileges itself - so I have called little scripts to install what is needed. This worked fine in 3.3.8.1. It seems to have changed in 3.3.10.2

As a test I wrote two very little scripts: TestRA

#RequireAdmin
MsgBox(0,"TestRA","This is running")

and Testnon

MsgBox(0,"Test","This is running")

then I wrote a script to call them.

$a=Run(@ScriptDir & "\testnon.exe")
$a1= "No"
if @error Then $a1="Yes"
$b= Run(@ScriptDir & "\testra.exe")

MsgBox(0,"Testing","Test non =" & $a & $a1& @CRLF &"Test ra=" & $b & @error)

$a=RunWait(@ScriptDir & "\testnon.exe")
MsgBox(0,"Test","Testnon = " & $a & @error)
$b= RunWait(@ScriptDir & "\testra.exe")
MsgBox(0,"Test","TestRA = " & $b & @error)

I have just installed the latest SCiTE.

Attached are the various output messages.

As you can tell Test RA didn't run either on Run or RunWait. Can anyone tell me what is wrong?

Any ideas gratefully received

Blessings

Graeme

post-84035-0-37231700-1396339282_thumb.p

Link to comment
Share on other sites

Just remembered another aspect of this problem - when it first started, the program ran the scripts with #requireadmin fine until I changed them and recompiled them. So the problem isn't running a script that was #requireadmin but the compiling of a script with #requireadmin. Looking through all the script changes etc I noticed that IsAdmin has changed and wondered if that had any thing to do with it?

Anyway thanks to all those who've looked. I hope someone has an answer for this...

BTW is it possible that this is a bug and should be discussed in a different forum??

Blessings

Graeme

Link to comment
Share on other sites

  • 4 months later...

Hi anyone,

I just ran this test with the same programs with the most up to date version of AutoIt and got the same bad result. I don't understand what I can be doing wrong. Can anyone tell me how to run a #requireadmin script from within a script. When I run TestRA by itself, it runs, but when I call it with Test RA it doesn't run.

Blessings

Graeme

Link to comment
Share on other sites

  • 2 weeks later...

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

×
×
  • Create New...