automatically open file?
Discussion
Can anyone point me towards a way (Win7 or Vista) to monitor a folder for new files, and automatically open them in the appropriate software registered for their extension?
I've tried various folder monitoring shareware options, and they only seem to want to let me move/rename/delete files rather than open them.
TIA,
Tol
I've tried various folder monitoring shareware options, and they only seem to want to let me move/rename/delete files rather than open them.
TIA,
Tol
Anatol said:
Can anyone point me towards a way (Win7 or Vista) to monitor a folder for new files, and automatically open them in the appropriate software registered for their extension?
I've tried various folder monitoring shareware options, and they only seem to want to let me move/rename/delete files rather than open them.
TIA,
Tol
you could probably write something in powershell script http://technet.microsoft.com/en-us/scriptcenter/dd... if your that way inclinedI've tried various folder monitoring shareware options, and they only seem to want to let me move/rename/delete files rather than open them.
TIA,
Tol
It's for writing up bodywork quotes. The idea is to snap a digital photo of the damage, have an eye-fi card in the camera that drops the photos via our wi-fi network into a directory on a tablet pc, then have the photo open straight away in an image editing suite for annotation and adding to the quote document.
The file monitoring software I've found intended for monitoring network shares allows you to filter out or in all sorts of file-types, I'd be ignoring anything but jpgs.
Unfortunately I've not found a piece of software yet that will allow me to open the file, just move/rename/delete etc.
Tol
The file monitoring software I've found intended for monitoring network shares allows you to filter out or in all sorts of file-types, I'd be ignoring anything but jpgs.
Unfortunately I've not found a piece of software yet that will allow me to open the file, just move/rename/delete etc.

Tol
A bit of a faff, but you could bodge it with windows scheduler and batch files.
Create a batch file with something like IF EXIST *.JPG THEN PAINT.EXE *.JPG type thing. Get that to run every minute or so and include a command to move the file to another folder once it's been opened.
Haven't given it much thought so may be wrong but seems feasible at the mo...
Create a batch file with something like IF EXIST *.JPG THEN PAINT.EXE *.JPG type thing. Get that to run every minute or so and include a command to move the file to another folder once it's been opened.
Haven't given it much thought so may be wrong but seems feasible at the mo...
You could give this a go, you would need change strMonitorFolder which is folder path using 4 slashes instead of one and the path to the application strAppPath
If you post up the path to the application and the folder I can modify it for you.
You need to save script as something.vbs
If you post up the path to the application and the folder I can modify it for you.
You need to save script as something.vbs
Dim strValidFileExt, strAppPath, strMonitorFolder
strValidFileExt = "JPG"
strAppPath = "c:\Windows\System32\mspaint.exe"
strMonitorFolder = "d:\\\\test\\\\new pics"
Set WshShell = WScript.CreateObject("WScript.Shell")
Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
Set colMonitoredEvents = objWMIService.ExecNotificationQuery _
("SELECT * FROM __InstanceOperationEvent WITHIN 1 WHERE Targetinstance ISA 'CIM_DirectoryContainsFile' and " _
& "TargetInstance.GroupComponent='Win32_Directory.Name=""" & strMonitorFolder & """'")
Do While TRUE
Set objEventObject = colMonitoredEvents.NextEvent()
If objEventObject.Path_.Class = "__InstanceCreationEvent" Then CheckFile()
Loop
Sub CheckFile()
strFilePath = objEventObject.TargetInstance.PartComponent
arrFilePath = Split(strFilePath, "=")
strFilePath = arrFilePath(1)
strFilePath = Replace(strFilePath, "\\", "\")
strFilePath = Replace(strFilePath, Chr(34), "")
strFileExt = right(strFilePath, 3)
If UCase(strFileExt) = strValidFileExt Then WshShell.Run strAppPath & " " & """" & strFilePath & """"
End Sub
No probs I just modified some scripts off the Scripting Guy the link gives you some details of whats going on.
It should keep running until the computer is shutdown or an error occurs, you can get it to start automatically when you log on by saving the following as something.reg and double click it.
Probably best to do this as script does not check to see if it already running.
It should keep running until the computer is shutdown or an error occurs, you can get it to start automatically when you log on by saving the following as something.reg and double click it.
Probably best to do this as script does not check to see if it already running.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
"MonitorFolder"="wscript d:\\test\\monitor.vbs"
Gassing Station | Computers, Gadgets & Stuff | Top of Page | What's New | My Stuff



