Jump to content

Problems running script


Recommended Posts

I discovered this problem trying to help someone in another thread but forgot about it.

Wondering if anyone could shed an light why this might be happening.

Not sure if its a scite issue or something else, so would appreciate suggestions.

If I run this code from scite, its all fine and nothing seems out of the ordinary.

Run("notepad.exe")
$hwnd = WinGetHandle("Untitled - Notepad")
While 1
    sleep(100)
WEnd

however if I run this code with the added #RequireAdmin, ir opens notepad, and scite reports the script as exited code 0, but the tray icon is still present and it reported as running in taskmanager too.

#RequireAdmin
Run("notepad.exe")
$hwnd = WinGetHandle("Untitled - Notepad")
While 1
    sleep(100)
WEnd

Its pretty difficult to debug your code from within scite when this is happening.

Edited by JohnOne

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

#RequireAdmin makes the script start a new copy of itself and request admin privileges for that (but only if it isn't running with admin privileges already), then the original exits.

There isn't much you can do about that I think, but you can work around it.

Like starting SciTE as admin.

Edit: clarity.

Edited by AdmiralAlkex
Link to comment
Share on other sites

#RequireAdmin makes the script start a new copy of itself and request admin privileges for that (but only if it isn't running with admin privileges already), then the original exits.

There isn't much you can do about that I think, but you can work around it.

Like starting SciTE as admin.

Edit: clarity.

Starting as admin solves the issue, thanks AdmiralAlkex.

I have never seen this issue before, and think it must be something to do with UAC being turned on, even with admin account.

@shawnw, no it is the other way around use admin and it exits in scite but the au3 script keeps running.

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

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...