Sign in to follow this  
Followers 0
chiners_68

asistance please..

6 posts in this topic

ive got this script but need the bit in red to run minimized but prefered hidden. how can i cahnge this to do what i want.

Opt("GUIOnEventMode", 1) ; Change to OnEvent mode

$started = 1

$mainwindow = GUICreate("Defragmentation", 200, 100)

GUICtrlCreateLabel("Automating defrag in 6 seconds", 30, 10)

$btnExit = GUICtrlCreateButton("Skip", 70, 50, 60)

;GUISetOnEvent($GUI_EVENT_CLOSE, "_Terminate")

GUICtrlSetOnEvent($btnExit, "_Terminate")

GUISetState(@SW_SHOW)

While 1

Sleep(6000)

If $started Then

run("defrag.exe c: -f")

EndIf

Exit

Wend

Func _Terminate()

Exit

EndFunc

Share this post


Link to post
Share on other sites



May want to look at ShellExecute() as well.


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

cheers

i was trying @SW_HIDE but it wouldnt work. ive put "" for working directorynow it works..

cheers

now, how can I get a system drive variable in place of C:

Edited by chiners_68

Share this post


Link to post
Share on other sites

cheers

i was trying @SW_HIDE but it wouldnt work. ive put "" for working directorynow it works..

cheers

now, how can I get a system drive variable in place of C:

Run("defrag.exe " & @HomeDrive & " -f", '', @SW_HIDE)

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

i changed it to minimize to chck it works & it apears not to run..

Run("defrag.exe " & @HomeDrive & " -f", ' ', @SW_MINIMIZE)

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