Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Thursday, September 12, 2013 8:48 AM
I have seen many alarm scripts and stop watch scripts but I need only an alarm script which is similar to our alarm we use at home to wake up in the morning.
Could you please help me out at the earliset.
Thanks in Advance
All replies (5)
Thursday, September 12, 2013 11:29 AM
I prepared the below script of my own. I may give you a hint to help you me out
But it is not working; dont know why
function alarm_pop_up
{
#Give time details you want for alarm
$alarm_details = "C:\powershell\alarm_details.txt"
#Give the display message for pop-up
$alarm_display = "C:\powershell\alarm_display.txt"
#system time
$a = Get-Date -DisplayHint Time
#time we give
$b = Get-Content "$alarm_details"
#comapring our-time and system-time
if ($a -eq $b)
{
Write-Host (Get-Content $alarm_display)
}
else
{
#if not equal call function alarm_pop_up
return;
}
}
Monday, September 16, 2013 12:25 PM
I had successfully written the code for automatic alarm pop-up to remind about the meeting
But could anyone please help me out, how to make the pop-up as priority on the screen. i.e., it should be shown above every window opened.
Example: If we are running this script in our local PC and working on RDP, the pop-up(the output result of the script which is running on local PC) should come over the RDP while we are working on it.
Tuesday, September 17, 2013 6:36 PM
function alarm_pop_up
{
#Give time details you want for alarm
$alarm_details = "C:\powershell\alarm_details.txt"
#Give the display message for pop-up
$alarm_display = "C:\powershell\alarm_display.txt"
#For testing purposes
#$alarm_display = "It's working !!!"
#system time
$a = Get-Date
#time we give
$b = Get-Content "$alarm_details"
#comapring our-time and system-time
if ($a -eq $b)
{
[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
[System.Windows.Forms.MessageBox]::Show("$alarm_display")
}
else
{
#if not equal call function alarm_pop_up
return;
}
}
#Call function
alarm_pop_up
How about this?
Wednesday, September 18, 2013 5:17 AM
Thom, I have got a simple coding as below:
$a = get-content "C:\siva\powershell\alarm_details2.txt"
$PopUp = $false
while($PopUp -ne $true)
{
$b = Get-Date -Format HHmmss
if($a -eq $b)
{
$c = new-object -comobject wscript.shell
$d = $c.popup(“You Have Work - PC install”,0,”Test Message Box”,1)
$PopUp = $true
}}
Wednesday, September 18, 2013 5:21 AM
See my script in the previos reply, its successfull but a case like:
If suppose the script is running in local PC and Im working on RDPs, the pop-up is not showing while working on RDp untill and unless I go back to my local PC desktop.
My goal is to make the pop-up as priority and though Im working on RDP, the pop-up should be shown(i.e., it shown be always on the top of the screen, though what work or how many RDPs im working with)
Regards,
Siva