AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

USB Detect & Launch - eg Scripts [GUI]

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Utilities & Resources
View previous topic :: View next topic  
Author Message
BoBo¨
Guest





PostPosted: Tue Jan 29, 2008 12:16 am    Post subject: USB Detect & Launch - eg Scripts [GUI] Reply with quote

Quote:
USB Detect & Launch

Introduction

This application allows you to automatically execute a script or application each time a USB storage device is plugged into your PC. Different scripts can be executed for different devices and it’s the volume label that determines what action to perform.

Some examples (dependent on the scripts you write) are:

Copy new podcasts to your MP3 player.. just like I describe here

Copy other media from specific folders onto your USB memory stick
Backup your USB memory stick automatically when it’s inserted
Backup files from your PC onto a portable hard drive (perhaps firing up a copy of Microsoft’s SyncToy or Robocopy)
Anything else you can think of that you can write in a script!
As I mentioned, the application does little more than detecting the USB device and launching a script determined by it’s volume label. The power comes from being able to write scripts to do whatever you like!

[More..]
Cool
Back to top
oldHacker



Joined: 06 Feb 2008
Posts: 3
Location: the land of enchantment

PostPosted: Wed Feb 06, 2008 12:31 am    Post subject: Reply with quote

also check out USBDeview from nirSoft. much smaller package with commandline support.

folks here would probably write their own Wink
Back to top
View user's profile Send private message
IsNull



Joined: 10 May 2007
Posts: 64
Location: .switzerland

PostPosted: Wed Feb 06, 2008 8:25 am    Post subject: Reply with quote

Code:

#Noenv
#Persistent

DriveGET, OutVorhanden, List, REMOVABLE
settimer, check, 100
return

check:
ret := scan4newDrives(OutVorhanden)

if (!ret){
;nothing here
}else{
msgbox Found new device! : %ret%  ;here you can add code, wich should be executet if a new USB Device is plugged in.
}
return

scan4newDrives(byref olddrives){

DriveGET, OutAktuell, List, REMOVABLE
Loop, parse, OutAktuell
{

if InStr(olddrives, a_loopfield) {
   ;still here
}else{
   ;found new device!
   olddrives := OutAktuell ;update
   return, % a_loopfield
}
olddrives := OutAktuell ;update
return, 0 ;no new devices found.
}
}

I've postet this code in the german Forum...
_________________
http://securityvision.ch
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Utilities & Resources All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group