Jump to content

Scripting Help: Auto Shut Down Immediately When There Is A Mouse Movement Or Keyboard Keypress


Recommended Posts

Thank you very much for all the warnings. Seriously, I am not doing it as much as what everyone thinks. Perhaps I realy should download it at home.

Just a question to ask, when I do a ProcessClose (" Process " ), the process still remains in the Taskbar as an Icon, How can I remove that?

Link to comment
Share on other sites

  • Replies 65
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

In the script above - how do I add in

Run ("C:\WINDOWS\system32\ssmyst.scr /s","")

So that it will run the screensaver once the script is launched?

Const $WM_SYSCommand = 274, $SC_MonitorPower = 61808, $Power_On = -1, $Power_Off = 2
$dll = DllOpen("user32.dll")
opt("TrayIconDebug", 1)
Dim $oldpos[2]
Dim $pos[2]
#include <Misc.au3>
$HWND = WinGetHandle(WinGetTitle("", ""))
HotKeySet("{Esc}", "_Exit")
Dim $s_keys[117] = [116, 
etc etc
Link to comment
Share on other sites

In the script above - how do I add in

Run ("C:\WINDOWS\system32\ssmyst.scr /s","")

So that it will run the screensaver once the script is launched?

Const $WM_SYSCommand = 274, $SC_MonitorPower = 61808, $Power_On = -1, $Power_Off = 2
$dll = DllOpen("user32.dll")
opt("TrayIconDebug", 1)
Dim $oldpos[2]
Dim $pos[2]
#include <Misc.au3>
$HWND = WinGetHandle(WinGetTitle("", ""))
HotKeySet("{Esc}", "_Exit")
Dim $s_keys[117] = [116, 
etc etc
I'd try copying and pasting it into the script.
Link to comment
Share on other sites

Yes. Have you tried running the script to see? Cannot seem to run the screensaver no matter when I put that line.

Hmm...

Yes, this line:

Run ("C:\WINDOWS\system32\ssmyst.scr /s","")

works for me on two different systems.

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

Yes, this line:

Run ("C:\WINDOWS\system32\ssmyst.scr /s","")

works for me on two different systems.

On Windows 2000 and possibly XP you probably will have more success with:

Run ("C:\WINNT\system32\ssmyst.scr /s","")

:)

Link to comment
Share on other sites

I think i might be the only one here that will say that personally i don't care if someone's computer is on or off during night or that his HDD led is working nicely. Maybe in a building where 5-10 ppl works everyone is so excited to see what's going on other guys computer, and maybe also the company cares for computer being on or off during night. But in big companies you won't see BOSS checking your computer or comming to you in the morning when he notice a led of your hdd working (why your boss would be staying late at night.. it is you who is supposed to work at that hours, not him ;p). I work in IT Dept and we just don't go over 500+ ppl in building and watch if HDD light is on or not.More to that, if computer is in Domain and is locked you can't just unlock it.. and see what User is doing...When you type in Administrator/domain admin password computer will ask you if you want to log out the current user, if not it will remain locked. Of course you can go and change user passwords by domain but you must have realy good reason to do so (users privacy, which is his account and password have to be respected in some way). So you can't realy see if the computer has p2p program running (at least not that way). Usually when we suspect that someone is using p2p (very visible on Firewall and other devices in company) we just come in and take the pc and check it for p2p software and any other virus related programs. If there was no owner in the place at that time, we just wait for someone to come in and admit that it's his computer. We never reported yet users to BOSSes or security department. We warn user that he shoudn't do it and we explain why. Warnings usually helps preety much. To make big story short.. P2P is BAD and I wouldn't make software that will just hide p2p so it wouldn't look like it's started. If it's installed on computer it's as bad as using it, and IT will find out. If you work with computers long enough you expect unexpected to happen. So even if some computer will reboot, hide screens, turn off monitor, shut itself.

My little company: Evotec (PL version: Evotec)

Link to comment
Share on other sites

Sorry going back to the Moniter OFF question - I tried and I tried and I tried but I cannot seem to get the moniter to off for a longer period !!..

Can anyone help please? :)

You asked for something.

You were given code.

The code seems to work for some monitors, but not for others.

I modified the code to make it work for me and my hardware.

http://www.autoitscript.com/forum/index.ph...ndpost&p=167034

In response to my code, you mentioned that having "...the Block Input code stops the script from closing any other programs..." I replied, "I see no reason why it should." ProcessClose should work... I don't plan on testing it for you just yet. If you want any more help from me on this, you need to post your version of the code that I posted with the ProcessClose line completed for a common app like notepad. You test it and tell me your results and then I'll test what you post.......

And there we are... I seem to be the only one that does not care that much if you get fired. :-)

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

  • Moderators

And there we are... I seem to be the only one that does not care that much if you get fired. :-)

:) ... That's a plato upset (1st time I ever seen it! :mellow:)

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

Plato so sorry about that. Did not notice the edit. The first time I ran the script it did not work and I did not know how to use the process closed. Just tried it an it works :) Thank you for your help.

Glad it worked. Let us know if you ever get fired over this. Maybe every few months you could dig up this thread and post an update like, "Still employed"...

Enjoy...

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

Suggestion: Make a verified backup of your source code and compiled script for when (not if) the admins come and FDISK and re-image your PC. You will then be able to show that to your next prospective employer.

Link to comment
Share on other sites

  • 2 weeks later...

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