Jump to content

hidden script with send commands?


Recommended Posts

Group,

I have a question about the possibility (or syntax) of running a script in either minimized or hidden mode that uses the 'send' command. We're trying to standardize certain settings within our enterprise, such as default monitor power off, etc. The following script works, but I would like to make it run without the user seeing anything. I believe the use of the 'send' command as well as my trying to insure the correct window is active is what is causing me the problem, how to insure the window is active without it showing...

Opt("WinWaitDelay",100)
Opt("WinTitleMatchMode",4)
Opt("WinDetectHiddenText",1)
Opt("MouseCoordMode",0)
Run('rundll32.exe shell32.dll,Control_RunDLL Powercfg.cpl',@SystemDir,@SW_HIDE)
WinWait("Power Options Properties","Select the power sch")
If Not WinActive("Power Options Properties","Select the power sch") Then WinActivate("Power Options Properties","Select the power sch")
WinWaitActive("Power Options Properties","Select the power sch")
Send("{TAB}{TAB}{TAB}{HOME}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{TAB}{TAB}{TAB}{TAB}{ENTER}


")

Any suggestions would be most appreciated.

Thanks,

ZenKensei

Link to post
Share on other sites

Hi,

When running in a Windows 2000 Environment u should consider the usage of Group Policies !

Andre

What about Windows without using AutoIt ?It would be the same as driving a car without an steering Wheel!
Link to post
Share on other sites

Andre,

The enterprise it not fully migrated to AD as of yet, and in the past we have found that this particular setting (as well as some of the other power settings) do not always work as anticipated within the GPO's. I was planning on pushing the script out either SMS or during logon....

Thanks,

ZK

Edited by ZenKensei
Link to post
Share on other sites

The send command is not the best way to handle this issue because it can be interupted by the user.

I suggest using the ControlCommand ( "title", "text", controlID, "SelectString", 'string') to set the value in the combo box then ControlClick to apply the settings.

Edited by bshoenhair
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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...