Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   Dev Hardware ForumsSOFTWAREProgramming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Hardware Forums Sponsor:
  Trader Rating: 0 · #1  
Old May 23rd, 2008, 12:46 AM
sokha sokha is offline
n00b DevH'er
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 2 sokha User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 42 m 39 sec
Reputation Power: 0
Unhappy VBS - Run vbs when usb is plugged

i have creat a .vbs file to open my .bat file and i want to run this file automatically whenever someone plug there usb in my computer. i have searched for many website in order to solve this problem but it's not suited what i want, because they always told me to use the autorun.inf in the removable drive to run the .vbs file. but i don't want to do like this cos i can't change the autorun.inf in the removable drive that someone else plug in my computer. so is there anyway to start my .vbs file without using the way above when the usb is plugged? Help me please.

Reply With Quote
  Trader Rating: 0 · #2  
Old May 23rd, 2008, 08:59 AM
DrStrangluv's Avatar
DrStrangluv DrStrangluv is offline
Contributing User
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: May 2007
Posts: 206 DrStrangluv User rank is Major (30000 - 40000 Reputation Level)DrStrangluv User rank is Major (30000 - 40000 Reputation Level)DrStrangluv User rank is Major (30000 - 40000 Reputation Level)DrStrangluv User rank is Major (30000 - 40000 Reputation Level)DrStrangluv User rank is Major (30000 - 40000 Reputation Level)DrStrangluv User rank is Major (30000 - 40000 Reputation Level)DrStrangluv User rank is Major (30000 - 40000 Reputation Level)DrStrangluv User rank is Major (30000 - 40000 Reputation Level)DrStrangluv User rank is Major (30000 - 40000 Reputation Level)DrStrangluv User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 5 Days 23 h 2 m 21 sec
Reputation Power: 320
There's nothing in windows to kick off an extra program when a usb drive in inserted. So the only way to do this is if you have a program that's running all the time. Since it needs to run all the time, you should probably build a windows service rather than a vbs.

Reply With Quote
  Trader Rating: 2 · #3  
Old May 23rd, 2008, 01:09 PM
Nilpo's Avatar
Nilpo Nilpo is online now
Dev Hardware God (5000 - 5499 posts)
 
Join Date: May 2004
Location: Salem, OH
Posts: 5,404 Nilpo User rank is General 78th Grade (Above 100000 Reputation Level)Nilpo User rank is General 78th Grade (Above 100000 Reputation Level)Nilpo User rank is General 78th Grade (Above 100000 Reputation Level)Nilpo User rank is General 78th Grade (Above 100000 Reputation Level)Nilpo User rank is General 78th Grade (Above 100000 Reputation Level)Nilpo User rank is General 78th Grade (Above 100000 Reputation Level)Nilpo User rank is General 78th Grade (Above 100000 Reputation Level)Nilpo User rank is General 78th Grade (Above 100000 Reputation Level)Nilpo User rank is General 78th Grade (Above 100000 Reputation Level)Nilpo User rank is General 78th Grade (Above 100000 Reputation Level)Nilpo User rank is General 78th Grade (Above 100000 Reputation Level)Nilpo User rank is General 78th Grade (Above 100000 Reputation Level)Nilpo User rank is General 78th Grade (Above 100000 Reputation Level)Nilpo User rank is General 78th Grade (Above 100000 Reputation Level)Nilpo User rank is General 78th Grade (Above 100000 Reputation Level)Nilpo User rank is General 78th Grade (Above 100000 Reputation Level)  Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 1 Month 1 Week 3 Days 19 h 42 m 53 sec
Reputation Power: 6193
Send a message via ICQ to Nilpo Send a message via AIM to Nilpo Send a message via MSN to Nilpo Send a message via Yahoo to Nilpo Send a message via Google Talk to Nilpo Send a message via Skype to Nilpo Send a message via XFire to Nilpo
MySpace Orkut
DrStrangluv is right that this should be a service.

However, VBS is not intended to do this as it is generally considered a security risk, but you can pull this off using WMI. Take a look at WMI Event programming. I've written several articles on ASP Free to point you in the right direction. I'd recommend monitoring for a new drive letter creation. Then you can attempt to determine whether or not it is a USB drive.
__________________
Click the image if at any point you don't like my decision.

10011100011000101111100011100000011000000100000011 10010011011110110001101101011011110100011000001110 0100111101000100001

Visit Nilpo.com and Ask the Windows Guru!

Open me for some very useful links!    

Reply With Quote
Reply

Viewing: Dev Hardware ForumsSOFTWAREProgramming > VBS - Run vbs when usb is plugged


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT