How to run a program right after user logon on win8? - windows

As all know, Win8's windows logon sound setting does't work, so I decided to run a program to play a welcome sound right after user logon.
I write a vbs file, and I added it in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run.
It works, but I still have to wait a few seconds to listen the welcome music after user logon. I think that might be because my vbs file doesn't run immediately after user logon, it might have to wait other programs that are also listed on startup menu before starting.
Could you help me?
(I know my english is so bad, I hope you can understand what I say (●'◡'●) )

Related

How do I make a custom-created windows schedule task not run in background?

I've made a scheduled task that repeats itself each 4 hours. The task is that it starts a program that automatically will shutdown in 4 hours from start. But when I have windows task scheduler set to open the software each 4 hours, it just starts the process, not opening an actual window. How can I solve this?
The user is set to the useraccount I'm logged in to, not system.
Answer was basic: I had selected "Run even if user is logged off", meaning it'd run it all in another session or something like that. So I tried selecting "Run only if user is logged in" and it works like a charm! :)

Windows directory locker implementation

** I want to do this for educational cause only, for myself, not to replace any system that is already implemented in the Windows OS **
I want to implement some kind of directory locker in Windows 10.
In order to do so, I want my program to run in the background, and every time it will identify a try to access a directory, it will search whether the directory is locked or not, and if it is locked, it will pump up a password insertion box.
I want to start by pumping up the password message box (first stage), and after that to actually block the access if the password is wrong (second stage).
Any leads?
There is nothing stopping the user from just killing your program and accessing the directory as normal. If you want to prevent someone from accessing something, use access controls -- that's what they're for. If the user is an administrator they can change the access controls to undo what you do; but if the user is admin they could just debug any program or process and completely replace the code that does the access check with code that does nothing.

Getting user uptime in bash script

I'm trying to write a bash script and need to learn how many seconds past since user logged in(xsession). I'm searching for hours and i couldn't find a solution for that. I found only uptime command but i think it's only get computers running time.
To be more clear...
I'm writing gui with gtkdialog and i have "hide gui on startup" option. I can start program when user login and if user check that option i can hide gui. But if user wants to configure options and open the gui again???
My only solution for that. I can write the condition if user logged in 30 sec ago or if not checked "hide gui on startup" option than show gui. So if user click program in xsession can see gui again.
You can get information about users currently logged in with te w and the who commands. If you would like to see a log about recent sessions (with login and logout time, etc) use the last command.

UI automation of mouse click at logon screen in windows 8.1

For UI automation testing purposes, I need to click a button on the windows 8.1 logon screen where it prompts to select a user account. And no, I do not need to select a user account. Its a button in particular. I am not quite sure how to do it. I tried to include my script as a Group Policy (gpedit.msc) startup script but its not working. But the same works when I include it as a Group Policy logon script.
I tried to directly include it in the registry as well under Group Policy startup scripts but it didn't work. Adding the script in the registry to be executed at logon works. My script is in Python.
Has anyone done anything like this by adding their script through gpedit.msc? (I might be doing something wrong at this step in that case). Other methods and ideas are good too. Any help is much appreciated. :)

Task Scheduler - Show me a message when I lock my computer

Here's what I need to happen:
When I leave the office for the day, I lock my computer. We're supposed to fill out our timecards before leaving. I always forget to do it. I want a message to be displayed when I attempt to lock my computer asking me if I've filled out my timecard.
Here's what I've done, and why it doesn't work:
I created a task under Task Scheduler with action = "Display a message" and trigger = "On workstation lock". The problem with this is the task doesn't run until the workstation is literally locked and I don't see the message until I log back in again, which is pointless.
How can I do this so immediately after I press Ctrl-Alt-Del, but before my computer actually locks the message is displayed?
Any help would be appreciated. Bonus points awarded for the following:
1) Display the message only if after say 3:00pm, as I lock my computer multiple times a day and I would get the message every time. The 3:00pm constraint would assume I'm leaving for the day and therefore, it should ask me if I've filled it out.
2) At the end of the message, display "Would you like to visit the timecard site?" and display 2 buttons, Yes and No. If I click yes, the locking of the workstation is cancelled and the timecard site opens up in my browser. If no is clicked, the workstation goes on to be locked.
Thanks.
You could pop your message up by calling MessageBox() with the MB_SERVICE_NOTIFICATION flag. That will cause the message box to be popped up on the console even if the logon screen is showing...
I doubt that this is possible. When you press CTRL+ALT+DEL Windows handles that key press and you can't get a look in.
What you could do would be to put a shortcut on you desktop that locked the computer, but only after having shown the message you so desire. I have a Lock Workstation shortcut on my desktop which is implemented with the following target:
C:\Windows\System32\rundll32.exe User32.dll,LockWorkStation
You could quite easily write your own script, or maybe even a small app. If the latter then you simply need to call the LockWorkStation function that is exported from user32.dll.
change the action to a program, run this program
msg username message
ie: msg patrick Please remember to do this.

Resources