Hi
I run scripts in the background of the computer and have one that needs to notify the logged in user when it finishes. Just about any type of notification message box or pop up bubble would be fine.
Example:
"We've upgraded your application in the background and you can start using it again."
How can this be accomplished?
Thanks in advance for any help.
Bob
background script needs to notify logged in user
Moderators: JRL, Dorian (MJT support)
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: background script needs to notify logged in user
Code: Select all
MessageModal>We've upgraded your application in the background and you can start using it again.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Re: background script needs to notify logged in user
Hi Marcus,
I should have mentioned, by "in the background" I meant I am logged into Windows on their computer as another user. I don't think message modal will work for that will it?
Bob
I should have mentioned, by "in the background" I meant I am logged into Windows on their computer as another user. I don't think message modal will work for that will it?
Bob
Re: background script needs to notify logged in user
I don't know your system or if you have Macro Scheduler Pro or multiple copies of Macro Scheduler. The way I'd do this is I would use a script similar to below and I'd compile it. I would set it in motion on the users computer and let it run forever, in fact I would have it in the start folder so it restarts every time the user logs in. The first line is setting variable vFileName to a file that is in a location accessible to both you and the user.
When you finish your process you write whatever message you want the user to see to the file that is defined in variable vFileName. The moment the file exists the text of the file will display in a Macro Scheduler message box on the users desktop. When the user dismisses the message the text file will be deleted.
On your end you might also want to do some checking in case the user does not dismiss the message (which deletes the text file) before you create a second text file.
When you finish your process you write whatever message you want the user to see to the file that is defined in variable vFileName. The moment the file exists the text of the file will display in a Macro Scheduler message box on the users desktop. When the user dismisses the message the text file will be deleted.
On your end you might also want to do some checking in case the user does not dismiss the message (which deletes the text file) before you create a second text file.
Code: Select all
Let>vFileName=L:\JRL\MessageFile.txt
OnEvent>File_Exists,vFileName,0,srtMessage
Label>Loop
Wait>0.01
Goto>Loop
SRT>srtMessage
ReadFile>vFileName,vData
MessageModal>vData
DeleteFile>vFileName
END>srtMessage
Re: background script needs to notify logged in user
JRL,
Thank you for the thoughtful response. Your method can be adopted for a lot of things is very flexible.
I also found that this works on any machine powershell is installed on. Keep in mind my need was for message to pop on local machine, not another machine. If you need to message another machine see the url in the comments.
Thank you for the thoughtful response. Your method can be adopted for a lot of things is very flexible.
I also found that this works on any machine powershell is installed on. Keep in mind my need was for message to pop on local machine, not another machine. If you need to message another machine see the url in the comments.
Code: Select all
/*
Msg Command Syntax
msg {username | sessionname | sessionid | @filename | *} [/server:servername] [/time:seconds] [/v] [/w] [message]
more here:
http://pcsupport.about.com/od/commandlinereference/p/msg-command.htm
*/
Let>RP_Admin=1
Run>powershell.exe msg * "Upgrade done! You may resume using Upgraded Program on this computer"
- CyberCitizen
- Automation Wizard
- Posts: 724
- Joined: Sun Jun 20, 2004 7:06 am
- Location: Adelaide, South Australia
Re: background script needs to notify logged in user
Code: Select all
Run>%SYS_NATIVE%\cmd.exe /c REG ADD "\\%SSTOOLS.COM%\HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v "AllowRemoteRPC" /t REG_DWORD /D 1 /F > "%TEMP_DIR%AllowRemoteRPC.txt"
//Run>%SYS_NATIVE%\cmd.exe /c MSG /V /TIME:172800 /SERVER:%SSTOOLS.COM% * <"%TEMP_DIR%MSGUtility.txt" >"%TEMP_DIR%MSGResponse.txt"
Run>%SYS_NATIVE%\cmd.exe /c MSG /V /TIME:172800 /SERVER:%SSTOOLS.COM% * <"%TEMP_DIR%MSGUtility.txt" >"%TEMP_DIR%MSGResponse.txt"
Run>%SYS_NATIVE%\cmd.exe /c REG ADD "\\%SSTOOLS.COM%\HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v "AllowRemoteRPC" /t REG_DWORD /D 0 /F > "%TEMP_DIR%AllowRemoteRPC.txt"
FIREFIGHTER