Jump to content

RunAs + WinSetTitle


Recommended Posts

When using RunAs (/profile + /env) i can no longer do things like WinSetTitle to the spawned window, i tried compiling a test script and running it as the same user in windows but still not able to change the title

Super awesome if someone can give me a tip here!

Link to comment
Share on other sites

less is more!

; Broken

$pid = RunAs("alternate_account", @ComputerName, "password", 4, "calc.exe")

; Works

;~ $pid = Run("calc.exe")

sleep(500)

$WinList = WinList()

for $i=1 to $WinList[0][0]

$wPID = WinGetProcess($WinList[$i][1])

if Not StringCompare($wPID, $pid) Then

ConsoleWrite("Found calc, setting title." & @LF)

WinSetTitle($WinList[$i][1], "", "Newitle")

EndIf

Next

I'm looking through security policies right now..

I'm on windows 7, tried both administrator and standard accounts for the RunAs username

Link to comment
Share on other sites

  • Moderators

Hi, ev0l. I tried your code on a Win7 VM and it worked just fine. Are you trying this on a standalone computer or in a domain setting?

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Hi, ev0l. I tried your code on a Win7 VM and it worked just fine. Are you trying this on a standalone computer or in a domain setting?

Hey, uhm damn ;)

I havent setup any domain stuff just default settings.. dident get a chance to work anymore on this yesterday ill do some more tests!

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