Camera Automation under Vista

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Camera Automation under Vista

Hi,

I am trying the get the following script to work under Vista:

<job>
<reference object="wia.DeviceManager" />
<object id="DevMan" progid="Wia.DeviceManager" />
<script language="VBScript">
Option Explicit

Dim Command, Name, Description, Icon, EventID, DeviceID, i

Command = WScript.fullname & " """ & WScript.scriptfullname & """ connect"
Name = "QuickTransfer"
Description = "Quick Scripting Transfer"
Icon = WScript.fullname & ", 0"
EventID = wiaEventDeviceConnected
DeviceID = "*"

If WScript.arguments.count = 1 then
If UCase(WScript.arguments(0)) = "REGISTER" then
MsgBox "Registering Event Handler"
DevMan.RegisterPersistentEvent Command, Name, Description, Icon, EventID, DeviceID
WScript.quit
End If
If UCase(WScript.arguments(0)) = "UNREGISTER" then
MsgBox "Unregistering Event Handler"
DevMan.UnregisterPersistentEvent Command, Name, Description, Icon, EventID, DeviceID
WScript.quit
End If
End If

If WScript.arguments.count = 2 then
If UCase(WScript.arguments(0)) = "REGISTER" then
MsgBox "Registering Event Handler"
DeviceID = WScript.arguments(1)
DevMan.RegisterPersistentEvent Command, Name, Description, Icon, EventID, DeviceID
WScript.quit
End If
If UCase(WScript.arguments(0)) = "UNREGISTER" then
MsgBox "Unregistering Event Handler"
DeviceID = WScript.arguments(1)
DevMan.UnregisterPersistentEvent Command, Name, Description, Icon, EventID, DeviceID
WScript.quit
End If
End If
..
..
..

When I execute the following command to register the script for my camera:

CopyPictures register {EEC5AD98-8080-425f-922A-DABF3DE3F69A}\0006

I get the follwing error:

Script: C:\Temp\CopyPictures.wsf
Line: 33
Char: 4
Error: Unspecified Error

Code: 80004005
Source: WIA.DeviceManager.1

Line 33 is this line of code:

DevMan.RegisterPersistentEvent Command, Name, Description, Icon, EventID, DeviceID

Can anyone tell me what might be wrong?

Thank You,
Tracy

.



Relevant Pages

  • Camera automation under Vista
    ... I am trying the get the following script to work under Vista: ... Dim Command, Name, Description, Icon, EventID, DeviceID, i ... MsgBox "Registering Event Handler" ... MsgBox "Unregistering Event Handler" ...
    (microsoft.public.scripting.vbscript)
  • Camera Automation under Vista
    ... I am trying the get the following script to work under Vista: ... Dim Command, Name, Description, Icon, EventID, DeviceID, i ... MsgBox "Registering Event Handler" ... MsgBox "Unregistering Event Handler" ...
    (microsoft.public.scripting.vbscript)
  • RE: Deleting printer from P&F without printer on network
    ... I suppose you have checked the DeviceID of the printer. ... Run this script on a client of yours, ... Set colInstalledPrinters = objWMIService.ExecQuery ("Select * from ... If you printer is not listed at all, always with the end user credentials, ...
    (microsoft.public.windows.server.scripting)
  • Re: Color printer help
    ... I saw no DeviceID property. ... Maybe try removing it. ... TDM ... > Im having problems with the following script. ...
    (microsoft.public.scripting.vbscript)
  • Re: Color printer help
    ... Sorry, forget my last post, got confused in the alphabetical list, DeviceID ... TDM ... > Im having problems with the following script. ... > Set objNewPort = objWMIService.Get _ ...
    (microsoft.public.scripting.vbscript)