![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | /\/\o\/\/ script to watch directory with popup Should this work with PSH RC2? http://mow001.blogspot.com/2005/10/m...ith-popup.html I just get a dump no matter what args I try: PS C:\[removed]\Desktop> .\watchdir GAC Version Location --- ------- -------- True v2.0.50727 C:\WINDOWS\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll True v2.0.50727 C:\WINDOWS\assembly\GAC_MSIL\System.Windows.Forms\2.0.0.0__b77a5c561934e089\System.Windows.For... PS C:\[removed]\Desktop> Nothing else seems to happen... No errors returned... Marco |
My System Specs![]() |
| | #2 (permalink) |
| Guest | RE: /\/\o\/\/ script to watch directory with popup This script defines a function. After the script scope ends, the function won't be defined anymore. You need to invoke it using the "." (dot-source it) from the PoSh prompt like so: PS> . C:\scripts\WatchDir.ps1 Once you did that, the function will stay defined at the interactive prompt. You can then invoke the function: PS> watch C:\scripts Hope that helps. -- greetings dreeschkind "Marco Shaw" wrote: > Should this work with PSH RC2? > > http://mow001.blogspot.com/2005/10/m...ith-popup.html > > I just get a dump no matter what args I try: > PS C:\[removed]\Desktop> .\watchdir > > GAC Version Location > --- ------- -------- > True v2.0.50727 > C:\WINDOWS\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll > True v2.0.50727 > C:\WINDOWS\assembly\GAC_MSIL\System.Windows.Forms\2.0.0.0__b77a5c561934e089\System.Windows.For... > > > PS C:\[removed]\Desktop> > > Nothing else seems to happen... No errors returned... > > Marco > > > |
My System Specs![]() |
| | #3 (permalink) |
| Guest | Re: /\/\o\/\/ script to watch directory with popup "dreeschkind" <dreeschkind@discussions.microsoft.com> wrote in message news:97BD9B88-0852-4367-A560-E96E00394084@microsoft.com... > This script defines a function. After the script scope ends, the function > won't be defined anymore. > You need to invoke it using the "." (dot-source it) from the PoSh prompt > like so: That did it. Now, I assume "popup" isn't something used from within Windows, and I need something to replace this "g:\monad\mow.ico" from the script so I get something in my systray, and can exit? |
My System Specs![]() |
| | #4 (permalink) |
| Guest | Re: /\/\o\/\/ script to watch directory with popup "Marco Shaw" wrote: > Now, I assume "popup" isn't something used from within Windows Sorry, I don't understand what you mean. The "popup" is called "BalloonTip" will appear in the Taskbar next to the NotifyIcon. See the line $NI.ShowBalloonTip(...) in mow's script. This is done by using .NET classes: System.Windows.Forms.* > and I need something to replace this "g:\monad\mow.ico" from the script so I get > something in my systray, and can exit? Yep, any Windows icon file should work. I suppose by saying you can't exit means that the console stops responding after calling the function. This is by design. ;-) You need to start a second powershell console (or any other app) to modify the content of the directory that is being watched. Once the watch function detected a change in that directory (e.g. a new file) it will show the popup and write something to the original console window. You can quit the directory watcher by using the context menu of the NotifyIcon. All this can of course be changed so you can trigger the popup when ever you like. -- greetings dreeschkind |
My System Specs![]() |
| | #5 (permalink) |
| Guest | Re: /\/\o\/\/ script to watch directory with popup Got it all working! I want to extend this to notifying me when a web page changes. I'll need to get a remote web page, then parse a section to determine if it has changed since the last run. If there's a change, send a popup. If the site had RSS, all of this wouldn't be required, but then again, I wouldn't have a challenge... Marco |
My System Specs![]() |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| active directory / office username script | Graham Turner | VB Script | 2 | 07-12-2008 09:04 PM |
| Help with Script to Create and Share User Directory | Scott Townsend | PowerShell | 5 | 12-12-2007 01:08 PM |
| MIIS provisioning Active Directory with powershell script MA | Alex | PowerShell | 0 | 05-25-2007 07:16 PM |
| Critique my Active Directory script | phappyman@gmail.com | PowerShell | 0 | 12-01-2006 04:22 PM |
| Script Watch-Command.ps1 and a related puzzle. | =?Utf-8?B?Um9tYW4gS3V6bWlu?= | PowerShell | 0 | 09-26-2006 08:29 AM |