Windows 7 Thread, Task Schedular Trigger in Technical; I am running MS SyncToy to sync some personal files from my laptop with an external hard drive. I am ...
29th March 2013, 03:42 AM #1
Task Schedular Trigger
I am running MS SyncToy to sync some personal files from my laptop with an external hard drive. I am using Windows 7 and have used the task scheduler to automate it. What I want it to do is to run upon a certain event. When My Passport is plugged into the usb port I want the task to run. Can a trigger be set on the laptop so it knows the hard drive is plugged in? I am not sure where these event is logged so it can trigger the task. Your suggestion is greatly appreciated.
IDG Tech News
2nd April 2013, 10:25 AM #2
This isn't supported natively, but if you could do it using USBDLM. Have a good read through the online help section on AutoRuns.
2nd April 2013, 11:45 AM #3
It is supported natively, otherwise you wouldn't be able to do this...
Originally Posted by AngryTechnician
PortableApps, SyncToy and Windows Task Scheduler
... or this (using Win32_VolumeChangeEvent)...
Monitoring Volume Change Events in PowerShell using WMI / http://superuser.com/a/93751
You could even bypass Task Scheduler altogether and register WMI events that trigger when a USB HDD/flash drive is inserted. For more info on this, Google 'Register-WmiEvent' (PS 2.0) or 'Register-CimIndicationEvent' (PS 3.0).
2nd April 2013, 03:27 PM #4
I stand corrected. However, the first example (using event log triggers) doesn't allow you to specify an event for a particular USB device (at least not without some serious XPath-fu that isn't in the UI). The example they give will trigger when any USB mass storage device is connected, which is undesirable in most use cases.
The second link looks more promising if the WMI query was expanded to check for a particular device ID, though in my book it's arguable whether something is 'native' to Windows if you have to write your own code...
Last edited by AngryTechnician; 2nd April 2013 at 03:29 PM.
By cookie_monster in forum Windows Server 2008
Last Post: 23rd November 2009, 11:47 AM
By GrumbleDook in forum Courses and Training
Last Post: 5th April 2006, 11:09 PM
By russdev in forum General EduGeek News/Announcements
Last Post: 24th March 2006, 10:19 AM
By Jake in forum How do you do....it?
Last Post: 6th January 2006, 01:16 PM
By tosca925 in forum Windows
Last Post: 8th November 2005, 10:45 AM
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread