PC Applications forum

General discussion

USB autorun for non storage devices

I'm looking for an application that will scan my USB ports for the insertion of a specific device then start an application.

I plan to use it so when I insert a USB joystick, my keyboard emulator will then run automatically.

Discussion is locked
You are posting a reply to: USB autorun for non storage devices
The posting of advertisements, profanity, or personal attacks is prohibited. Please refer to our CNET Forums policies for details. All submitted content is subject to our Terms of Use.
Track this discussion and email me when there are updates

If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.

You are reporting the following post: USB autorun for non storage devices
This post has been flagged and will be reviewed by our staff. Thank you for helping us maintain CNET's great community.
Sorry, there was a problem flagging this post. Please try again now or at a later time.
If you believe this post is offensive or violates the CNET Forums' Usage policies, you can report it below (this will not automatically remove the post). Once reported, our moderators will be notified and the post will be reviewed.
Collapse -
You'll have to write it.

In reply to: USB autorun for non storage devices

It's not a big piece of code and if you are a programmer I'd say it would take a week or less to accomplish.

Bob

Collapse -
vbasic

In reply to: You'll have to write it.

Was afraid of that. No I'm not a programmer (unless you count vbasic). I was really hoping that someone had a similar idea as me and already had something coded.

If I were to code it myself could it be done with vbasic? Or is it not advanced enough to control/monitor windows on that level.

Collapse -
In VB6 it wouldn't be too hard.

In reply to: vbasic

Here's the drill.

1. Go get REGMON (see google.com)

2. Now with REGMON look to see what registry changes there are when the device is ENUMERATED (fancy word about Windows adding the device).

3. Now in your VB6 routine, have it watch for this key to change/appear and launch your app.

Seems like a day's work or less.

Bob

Collapse -
Finished

In reply to: In VB6 it wouldn't be too hard.

Nah, your right didn't take me too long at all.

I was impressed just how well it did work. Check it out, SlyBadger

Collapse -
A code passage I use a lot. Sleep...

In reply to: Finished

'This gives us access to a sleep function.
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)


I find many programmers don't have a proper Sleep in VB and tend to see the CPU METER at 100% if they loop on DOEVENTS.

Useful?

Bob

Collapse -
Very

In reply to: A code passage I use a lot. Sleep...

Personally I don't let my computer sleep, but it would be useful for others I'm distributing to.

All that needs to work is to be declared?

Collapse -
Yes.

In reply to: Very

I offered if because if you are looping in your code POLLING for the registry change, you'll peg the CPU meter and others will not like your software doing that.

This one liner lets you poll and give back time to the CPU to not peg the CPU.

Bob

Collapse -
ok

In reply to: Yes.

Thanks for the information!

Popular Forums

icon
Computer Newbies 10,686 discussions
icon
Computer Help 54,365 discussions
icon
Laptops 21,181 discussions
icon
Networking & Wireless 16,313 discussions
icon
Phones 17,137 discussions
icon
Security 31,287 discussions
icon
TVs & Home Theaters 22,101 discussions
icon
Windows 7 8,164 discussions
icon
Windows 10 2,657 discussions

GIVEAWAY

Enter to win* a free holiday tech gift!

CNET's giving five lucky winners the gift of their choice valued up to $250!