Jump to content

asistance please..


Recommended Posts

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

Link to comment
Share on other sites

  • Moderators

May want to look at ShellExecute() as well.

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.

Link to comment
Share on other sites

  • Moderators

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)

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.

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