Add programs as USB events (XP)?

All non-XnView related: softwares, formats, imaging, photography...

Moderators: XnTriq, helmut, xnview

Post Reply
User avatar
Drahken
Posts: 884
Joined: Sun Apr 10, 2005 4:29 pm

Add programs as USB events (XP)?

Post by Drahken »

Anyone know how to add programs to the list offered when you connect a USB device or portable drive in windows XP?
Oh the feuhrer, oh the feuhrer, oh the feuhrer's nipples bonk!
User avatar
XnTriq
Moderator & Librarian
Posts: 6336
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Post by XnTriq »

Tips for USB pen drives » [url=http://www.uwe-sieber.de/usbstick_e.html#automatic]Automatic actions on plug in and out[/url] wrote:Using the c't USB Agent from german computer magazine c't 26/2002 you can let execute programs when a flash drive is plugged in or logged off. When you simple plug out it's too late...
It works under Windows 2000 and XP only: c't USB Agent
The ctusbag.exe comes on the harddrive and - if you like it - a link into the startup folder.
Put the usbagent.inf in the root of the flash drive. The agent waits for a plugin of logoff event and executes the commandline you have configured in the usbagent.inf found on the flash drive.
The sample usbagent.inf looks so:

[usbagent]
ON=notepad.exe
OFF=sol.exe

This would start notepad.exe on plugin and sol.exe on logoff.

My USB drive letter manager can enable the autorun.inf open= line known from CD-ROMs. Actions on removal arn't yet implemeted. Does anyone need this?
[url=http://www.uwe-sieber.de/usbdlm_e.html]USBDLM (USB Drive Letter Manager)[/url] » History wrote:V3.0.0 (3rd Oct. 2006)
  • Apply setting on service start to catch internal card readers and drives that are attached while booting
  • new function for section [ExcludedLetters]: You can define then letters that shall never be used for USB drives
  • reading [ExcludedLetters] from a foreign location so you can easily define excluded letters for all clients in a network
  • executing the open line in a autorun.inf on removeable drives
  • global autorun on arrival of any USB and Firewire drive
  • Show a balloon tip with information about the assingned mountpoints
  • Arnaud Pons: APO USB Autorun Suite
    APO USB Autorun Suite enables you to add autorun functionality to your USB drive. It provides an Autorun.inf Builder and a standalone portable Starter too.
  • Associazione Culturale Oltre l'immagine: MyPendrive
    MyPendrive has been developed to enable extended autorun functions for all USB drives, expecially for USB keys (and mp3 players, even if at the moment MyPendrive has no special functions for them).
  • KMG Software: Busrunner
    The Ultimate tool for any USB Drive-Carrying computer professional. Ever wish that your computer would allow you to AutoRun USB devices? Installing Busrunner on computers you use frequently allows you to have any program, on your USB drive or the machine itself, execute upon insertion of your USB Drive. Supports Windows XP and multiple USB drives at one time.
  • ToroSoft: AutoRun USB
    AutoRun USB does the same thing for USB Flash Drives that autorun.inf files do for CD's! Automatically launch the program of your choice on your USB Flash Drive everytime you plug it in! No more searching for exe's through file explorer, just plug it in and go! Upgrade to AutoRun USB Executive Edition to add even more functionality, including customizeable popup menus!
User avatar
XnTriq
Moderator & Librarian
Posts: 6336
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Post by XnTriq »

Drahken, I'm well aware that the programs in my previous post are not exactly what you are looking for.
When I was searching for an answer to this myself a few months ago, I couldn't find a proper solution.
But I think I've got a winner this time around: Please report back whether or not this worked for you.

BTW, these are the entries XnView puts into my Windows 2000 registry when I check the Add XnView as applications for USB events (camera, scan, ...) setting:

XnView v1.8.2.4 (Tools » Options » Install)

Code: Select all

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\StillImage\Registered Applications]
"XnView"="\"C:\\Program Files\\XnView\\xnview.exe\" -scan"
XnView v1.90 beta 1 (Tools » Options » System Integration)

Code: Select all

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\StillImage\Registered Applications]
"XnView"="\"C:\\Program Files\\XnView\\xnview.exe\" /StiDevice:%1 /StiEvent:%2"
ckit
XnThusiast
Posts: 2557
Joined: Tue Feb 17, 2004 1:11 am
Location: Cabarlah, Australia

Post by ckit »

XnTriq wrote: XnView v1.8.2.4 (Tools » Options » Install)

Code: Select all

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\StillImage\Registered Applications]
"XnView"=""C:\\Program Files\\XnView\\xnview.exe" -scan"
XnView v1.90 beta 1 (Tools » Options » System Integration)

Code: Select all

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\StillImage\Registered Applications]
"XnView"=""C:\\Program Files\\XnView\\xnview.exe" /StiDevice:%1 /StiEvent:%2"
Pierre, was this changed for compatibility with Vista?
I've got the newer one now in my registry anyhow.
AMD Ryzen 3 3300X 3.8Ghz, 16Gb DDR4, RX6600XT with Dell U2520D at 2560x1440@60Hz
Windows 11 Pro x64 23H2, PowerToys and Wintoys
User avatar
Drahken
Posts: 884
Joined: Sun Apr 10, 2005 4:29 pm

Post by Drahken »

Adding xnview as a usb event is ineffective. It adds the entry into the registry fine, but it doesn't appear as an option when a camera is connected.
Oh the feuhrer, oh the feuhrer, oh the feuhrer's nipples bonk!
User avatar
XnTriq
Moderator & Librarian
Posts: 6336
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Post by XnTriq »

This is from September of last year:
xnview ([url=http://newsgroup.xnview.com/viewtopic.php?t=3555]XnView start on DigiCam detect?[/url]) wrote:
Maik wrote:I want want to show the images from my canon camera automatic when I connect it to the computer. I whant to do this with xnview instead of the windows imaging tool.

I tryed to do this with the registry key ""C:\Programme\XnView\xnview.exe" /StiDevice:%1 /StiEvent:%2"

XnView starts correctly, but shows the errormessage "Kann Datei {6BDD1FC6-810F-11D0-BEC7-08002BE2092F}\0000 nicht öffnen".

Are the parameters /StiDevice:%1 /StiEvent:%2 ok?
Where is my error?
Currently not possible
... and this is what I've got in my registry:

Code: Select all

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\StillImage\Registered Applications]
"Imaging"=""C:\\Program Files\\Windows NT\\Accessories\\ImageVue\\KodakImg.exe" /StiDevice:%1 /StiEvent:%2"
"Photoshop"="C:\\Program Files\\Adobe\\Photoshop\\Photoshp.exe /StiDevice:%1 /StiEvent:%2"
"ThumbsPlus"="C:\\Program Files\\ThumbsPlus\\tpview.exe /StiDevice:%1 /StiEvent:%2"
"XnView"=""C:\\Program Files\\XnView\\xnview.exe" /StiDevice:%1 /StiEvent:%2"
:? So, is this a bug or does it mean XnView isn't “push-model aware”?

------------------------------------------------------------------------->8
  • Partner Pack for Windows
    • Download details for Microsoft USB Flash Drive Manager
      The Microsoft USB Flash Drive Manager will help you backup and restore presentation, pictures, songs and applications from and to USB Flash Drive devices and take them with you. The application can also help you to classify and name USB Flash Drives images (for instance “My network configuration” or “The pictures for my grandma”) and lets you see this name whenever the USB Flash Drive is plugged into the computer.
  • Windows Hardware Development Central
    • UVCView — Diagnostic Tool for USB Video Class Hardware
      UVCView is a tool for examining the device descriptors on USB peripherals. This update of UVCView includes fixes for errors reported by the development community. UVCView is based on the USBView tool, which is available as a sample with source code in the Microsoft Windows DDK.
    • WDM Still Image Architecture
      This paper describes the architecture and components that provide for acquisition of images from devices primarily used for capturing still pictures using scanners and digital still cameras under the Microsoft Windows 98 and Windows 2000 operating systems.
  • MSDN Library
    • MSDN Magazine — The Microsoft Journal for Developers
      • Autoplay in Windows XP: Automatically Detect and React to New Devices on a System
        The last few years have seen dramatic growth in digital multimedia content and an increasing number of devices generating such content. Accordingly, the Autoplay feature of Microsoft Windows has been enhanced to handle these scenarios. This article presents samples that use the new features and provides advice on how to take advantage of these additions. The topics covered include Autoplay support for audio CDs and for DVD movies, the Autoplay registration process, event handlers, and how your software can cancel Autoplay when you don't want certain files interrupted. The download includes tools for diagnosing problems and to help the reader understand the shell hardware detection service processing of hardware events.
        • Download details for Microsoft AutoPlay Repair Wizard
          The Microsoft AutoPlay Repair Wizard scans your computer devices to find defective AutoPlay settings, and attempts to fix those it finds.
    • Shell Programmer's Guide: Using Hardware AutoPlay
      • Using and Configuring AutoPlay
        When the Shell detects the insertion of new media or the attachment of a hot-plug device, the contents of the device or media are determined.
      • Preparing Hardware and Software for Use with AutoPlay
        Several pieces of information need to appear in the registry for AutoPlay to function. These pieces of information interact and reference each other to form the full AutoPlay environment. This document presents the setup of each of these pieces of information as an individual stand-alone procedure.
    • Windows Driver Kit: Imaging Devices
User avatar
Olivier_G
XnThusiast
Posts: 1423
Joined: Thu Dec 23, 2004 7:17 pm
Location: Paris, France
Contact:

Post by Olivier_G »

XnTriq, you have a gift for making great indented lists! I just love them... :mrgreen:
Olivier
User avatar
XnTriq
Moderator & Librarian
Posts: 6336
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Post by XnTriq »

:o Now that's quite a compliment coming from you, Olivier le Berserk!
You're not mocking me though, are you? Because others might look at my “gift” as more of a mixed blessing, if not a curse. :P
But to me information is easiest to digest if it is presented in an hierarchically structured manner; and we both like things to be K.I.S.S.-compliant, right?

P.S.: Sorry for the late reply. I found your post while trying to catch up with you guys.
I wonder what's going on with the topic reply notification feature of phpBB: Sometimes I don't receive an e-mail, but then again I'm getting “false positives”. :?
Anyway — Thanks for the nice comment, buddy. Have a Joyeux Noël!
davea0511

Post by davea0511 »

I would also like to see this work. Windows still gives an error when XnView is chosen as the application to handle the USB device.
User avatar
XnTriq
Moderator & Librarian
Posts: 6336
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Post by XnTriq »

davea0511 wrote:I would also like to see this work. Windows still gives an error when XnView is chosen as the application to handle the USB device.
:arrow: XnView Media Detector
Post Reply