Sign in to follow this  
Followers 0
nobby

RunAsSet and @SW_HIDE

7 posts in this topic

Hey,

When running the following script, notepad is hidden:

RunWait("notepad.exe","",@SW_HIDE)

But if I use the same line with RunAsSet, notepad is visible:

RunAsSet("administrator", "domain", "password", 0)
RunWait("notepad.exe","",@SW_HIDE)
RunAsSet()

Is there a way of hiding notepad (or any other programs) when running as?


CheersNobby

Share this post


Link to post
Share on other sites



Hey,

When running the following script, notepad is hidden:

RunWait("notepad.exe","",@SW_HIDE)

But if I use the same line with RunAsSet, notepad is visible:

RunAsSet("administrator", "domain", "password", 0)
RunWait("notepad.exe","",@SW_HIDE)
RunAsSet()

Is there a way of hiding notepad (or any other programs) when running as?

<{POST_SNAPBACK}>

Rerun your own script with specific parameters and in the beginning of your script check if the specific parameters were passed and then run notepad with @SW_HIDE.

Share this post


Link to post
Share on other sites

Here is a way of getting around it, not very pretty but it works.

Split the script in 2, use the first to call the second as Admin

Script1

RunAsSet("administrator", "domain", "password", 0)
Run("script2.exe","",@SW_HIDE)
RunAsSet()

Script2

RunWait("notepad.exe","",@SW_HIDE)

CheersNobby

Share this post


Link to post
Share on other sites

Hi,

Tried it here also,

Looks like an bug to me ?

Andre


What about Windows without using AutoIt ?It would be the same as driving a car without an steering Wheel!

Share this post


Link to post
Share on other sites

Looks like an bug to me ?

Yes it is a bug in windows. I don't think AutoIt can work around it.

Share this post


Link to post
Share on other sites

Yes it is a bug in windows. I don't think AutoIt can work around it.

<{POST_SNAPBACK}>

Here a workaround posted a while ago...

its a script example which restars itself ..


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Here a workaround posted a while ago...

its a script example which restars itself ..

<{POST_SNAPBACK}>

Yep, that's what I said. You can work around it. But I don't think AutoIt should have a workaround for this.

Share this post


Link to post
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
Sign in to follow this  
Followers 0