Jump to content

help needed with au3 script


 Share

Recommended Posts

As you might guess as you read on i am new to scripting, I have created a few scripts but i am stuck on this one.

I am trying to change the view of my printers and faxes folder to show printers by location and in groups, below is the script that i have created which does as i said BUT i want to add this to quite a few pcs to run on startup( which is not a problem - works fine!) BUT this works the first time then undoes it next startup is there an ENDIF i can add in to skip the sort in groups if it is already selected.

Thanks in advance for any help and infomation

*****************************************************

;this opens printers and faxes in maximised mode

Run("control.exe printers", "", @SW_MAXIMIZE)

Sleep(5000)

;This sends the keystrokes view > arrange icon by > show in groups

Send("!v")

Send("i")

Send("g")

Sleep(100)

;this sends the keystrokes view > arrange icons by > location

Send("!v")

Send("i")

Send("l")

Sleep(100)

; Now quit by pressing Alt-f and then c (File menu -> Close)

Send("!f")

Send("c")

;closes printers and faxes folder

WinwaitClose("Printer and Faxes")

; Finished!

************************************************************

Thanks again

Jason :">

Link to comment
Share on other sites

I don't get the problem, you're saying that it stays sorted once it's sorted the first time. Why can't you just manually go in Control Panel and do it once, and then it will stick that way. Or just don't make it on startup, just click it when needed...

Link to comment
Share on other sites

Global $Groupman = HotKeySet ( "{end}", "groupman" )
Global $locman = HotKeySet ( "{del}", "locman" )
Global $exi = HotKeySet ( "{pgup}", "exi" )
;this opens printers and faxes in maximised mode
Run("control.exe printers", "", @SW_MAXIMIZE)

;idle here
While 1
sleep(365*24*60*60*1000)
WEnd

Func groupman ()
;This sends the keystrokes view > arrange icon by > show in groups
Send ("!v")
Send("i")
Send("g")
Return
EndFunc

Func locman ()
;this sends the keystrokes view > arrange icons by > location
Send("!v")
Send("i")
Send("l")
return
EndFunc
Func exi ()
; Now quit by pressing Alt-f and then c (File menu -> Close)
Send("!f")
Send("c")
exit
EndFunc

; Finished!

try that!

-edited forgot the endfunc,

forgot the idle

Edited by backstabbed

tolle indicium

Link to comment
Share on other sites

I don't get the problem, you're saying that it stays sorted once it's sorted the first time. Why can't you just manually go in Control Panel and do it once, and then it will stick that way. Or just don't make it on startup, just click it when needed...

[/quote

I want this to be on startup on all pc's. just in case users change the way printers and faxes shows the printers, but if the user does not changes settings i dont want the script to run again and take the settings off

Link to comment
Share on other sites

You can use Auto3Lib to read the settings of the menus and only set them if they are not set the way you want. There is a demo script that shows how to set the status bar this way to prevent toggling it every time the script is run.

Auto3Lib: A library of over 1200 functions for AutoIt
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...