Jump to content

Recommended Posts

Posted

Hi everyone! :)

first off i will only use this script for private purposes - i wont send it to anyone.

I need a script that i will put in my autostart. it has to run a specific .exe and immediately hide it from the taskbar, so people cannot see it (it can appear in taskmanager tho, i dont care about that).

Ill just call that .exe "program1" for now. the thing is, that the program1 will automatically close if program2 is being run.. so it needs to be started again by the script, when program2 is being closed.

this might sound complicated at first but infact its quite simple. i just need to hide the program1 from any other people and still having it running ;)

so my primary question is, is it possible to hide a program completely from the taskbar etc with autoit3? and how? :D

thanks alot to anyone who tries to help me

  • Moderators
Posted

#NoTrayIcon

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.

Posted

Something like this?

HotkeySet("{esc}","_quit")
While 1
    $iPid  Run("Program1.exe","".@SW_HIDE)
    While ProcessExists($iPid)
        Sleep(250)
    WEnd
    
    While ProcessExists("Process2.exe")
        Sleep(250)
    WEnd
    
WEnd

Func _quit()
    Exit
EndFunc
Posted

Thanks to anyone so far, i got the basics of the code i need now :)

But, is there any way to let the script check if a process is being closed? cause i need to run the program1 again immediately if the program2 is being shut down.

  • Moderators
Posted

OnAutoItExit

Anymore information than that is typical of malware type.

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.

Posted

Thanks to anyone so far, i got the basics of the code i need now :)

But, is there any way to let the script check if a process is being closed? cause i need to run the program1 again immediately if the program2 is being shut down.

What I wrote does that, you just need to know what the process is called for Program2, it's in a loop

You run Program1, it loops until program2 closes it, then it loops while program2 is running then when program2 exits it goes back to the beginning and launches program1

Posted

What I wrote does that, you just need to know what the process is called for Program2, it's in a loop

You run Program1, it loops until program2 closes it, then it loops while program2 is running then when program2 exits it goes back to the beginning and launches program1

oh - thank you, gotcha now :)

well, i worked my own code out and it works like a charm now (might look a bit inconvenient in your eyes but its fine for me)

#NoTrayIcon
ProcessSetPriority ( "script.exe" , 0 )


If ProcessExists ( "program1.exe" ) Then
    ProcessClose ( "program1.exe" )
EndIf

        Sleep (250)
        
Run ("program2.exe" , "" , "@SW_HIDE")
ProcessWait ( "program2.exe" )

If ProcessExists ( "program2.exe" ) Then
ProcessWaitClose ( "program2.exe" )
EndIf

Run ( "script.exe" )

thank u all =]

Posted (edited)

where are your EndIf's ?

:)

He doesn't need them ;)

EDIT: To clarify, he doesn't need them because it is a single line IF statement.

Edited by Senton-Bomb
Posted

He doesn't need them :)

EDIT: To clarify, he doesn't need them because it is a single line IF statement.

AH

1-800-AUT-OIT3 Would be the coolest # Ever ;)

Posted (edited)

I need a script that i will put in my autostart. it has to run a specific .exe and immediately hide it from the taskbar, so people cannot see it (it can appear in taskmanager tho, i dont care about that).

Ill just call that .exe "program1" for now. the thing is, that the program1 will automatically close if program2 is being run.. so it needs to be started again by the script, when program2 is being closed.

oh - thank you, gotcha now :)

well, i worked my own code out and it works like a charm now (might look a bit inconvenient in your eyes but its fine for me)

#NoTrayIcon
ProcessSetPriority ( "script.exe" , 0 )


If ProcessExists ( "program1.exe" ) Then
    ProcessClose ( "program1.exe" )
EndIf

        Sleep (250)
        
Run ("program2.exe" , "" , "@SW_HIDE")
ProcessWait ( "program2.exe" )

If ProcessExists ( "program2.exe" ) Then
ProcessWaitClose ( "program2.exe" )
EndIf

Run ( "script.exe" )

thank u all =]

Well thats not what you said.. Run program1, then when program2 runs program1 automatically closes then when program2 finishes you want to re-run program1

What you wrote is the total reverse of what you asked at the top

Edited by ChrisL
Posted

Well thats not what you said.. Run program1, then when program2 runs program1 automatically closes then when program2 finishes you want to re-run program1

What you wrote is the total reverse of what you asked at the top

its not, i think u just got me wrong - the point is, that program2 automatically closes program1 itself. whatever, it worked now and u guys helped me a lot. didnt do any autoit in ages :}

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
×
×
  • Create New...