Sign in to follow this  
Followers 0
jamesrandi

Hiding a program from the taskbar etc

16 posts in this topic

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

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 =]

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

This looks better:

#NoTrayIcon

ProcessSetPriority("Script.exe", 0)

If ProcessExists("Program1.exe") Then ProcessClose("Program1.exe")

Sleep (250)
        
Run("Program2.exe",  "" , "@SW_HIDE")

ProcessWait("Program2.exe")

If ProcessExists("Program2.exe" ) Then ProcessWaitClose("Program2.exe")

Run("Script.exe")
Edited by JustinReno

Share this post


Link to post
Share on other sites

#11 ·  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

Share this post


Link to post
Share on other sites

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 ;)

Share this post


Link to post
Share on other sites

AH

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

That was random.

Share this post


Link to post
Share on other sites

That was random.

yeah i agree

i just copied it from the text under sentons avatar

Share this post


Link to post
Share on other sites

#15 ·  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

Share this post


Link to post
Share on other sites

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 :}

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