|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|||
|
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.
|
|
||||
|
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!
![]() |
![]() |
| Viewing: Dev Hardware Forums > SOFTWARE > Programming > VBS - Run vbs when usb is plugged |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|