Auto-executing a script by plugging in a USB Stick - How?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Auto-executing a script by plugging in a USB Stick - How?
# 1  
Old 05-07-2010
Question Auto-executing a script by plugging in a USB Stick - How?

I have a script. And I want it to be executed whenever I plug in my stick in my PC or in other PCs.
I have heard about udev rules but they doesn't suit me, i have to do the same thing in more of 6 PCs - tiring.
So, is there any way to auto-execute a script when the USB is plugged in?Smilie
# 2  
Old 05-07-2010
and how exactly would this be safe for the owner of the workstation...? or the network...?
# 3  
Old 05-07-2010
This is NOT the question.
I just did a question. Don't reply with another question. I was explicit I think...
# 4  
Old 05-07-2010
You were pretty explicit...except it's also pretty obviously the wrong path to take.

You might want to re-think your delivery mechanism, and put the script onto a share that you could then access. If it requires something like Perl in order to run, you'd want to be sure that it's also available via some share. UNC nomenclature is a good thing to be familiar with...

USB keys...and U3-type of autoexecs, are fairly suspect in many environments. I've seen offices physically disable USB ports (such as with a quick screwdriver twist...) just as a safeguard against the prospect that folks might try to adopt your approach...benevolent intent or not.
# 5  
Old 05-07-2010
So, as I understood there isn't something like "autorun.inf" files or something like that that auto-run programs from inside of the USB, aren't they?
# 6  
Old 05-07-2010
Different OSs may be able to auto-detect the additional hardware, and subsequently prompt you for directions...even with an option for a default behavior, but it won't go so far as to execute a given script just by plugging in a USB key.

That would be a security nightmare...
# 7  
Old 05-07-2010
Yeah, it is true that windows face serious problems from auto-running programs.
Ok, thx for your answer
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. BSD

Bootable usb-stick, need help, sos

I would probably set all my rubber points here to get some real help for creating a boot device on a usb-stick. There is no CD-drive on this machine, thats why I need to use a usb-stick. And scrumming in a CD-drive to fuddle around in the fstab or something like that is out of reach. My wisdom so... (9 Replies)
Discussion started by: 1in10
9 Replies

2. SCO

How to use USB Stick in UNIXware?

I am trying to use a USB (Pen?) drive on Unixware 7.1.4. The USB stick is in the machine and the machine recognises it when I enter usbprobe as follows: Path - Address Description ----------------------------- +++++++ BUS #2 0 - 1 - HUB "UHCI Root Hub" 1 - 2 - HID "Chicony Wireless Device"... (1 Reply)
Discussion started by: BernP
1 Replies

3. Ubuntu

Installing UBUNTU on USB stick

I'd like to install the OS on my stick. I would like to be able to save my works there and install apps or customize the OS. What can I do Ps. At home I use an iMac, but in the school where I work there are only PC... Ty (2 Replies)
Discussion started by: Fabio_Puricelli
2 Replies

4. Shell Programming and Scripting

Auto run script on USB device

Okay I want to write a script that I put on a jump drive. And when you plug the USB in this script executes. How would i go about doing this? I don't care what the program does right now. I just want to know how this would be done. Any ideas? (1 Reply)
Discussion started by: cbreiny
1 Replies

5. SCO

Mount USB stick

hi Howto mount an USB stick under SCO 5.0.7? BTW ist it possible to mount USB stick in the command line using 'tools' at the Boot: prompt from OpenServer Release 5.0.7 installation CD? (1 Reply)
Discussion started by: ccc
1 Replies

6. Ubuntu

Ubuntu on USB stick?

Hey Guys I have an Ubuntu CD and I was thinking of creating like a bootable hard drive with various OS so that I can just boot OSs with t drive and not require the CDs. I was just wondering is there a way I can do this, like have Ubuntu boot from a USB stick? If yes how is that possible(even if I... (3 Replies)
Discussion started by: rbansal2
3 Replies

7. BSD

Mounting a USB stick in FreeBSD

When mounting a USB stick or pen drive on a FreeBSD machine I always issue the following command: mount -t msdosfs /dev/da0s1 /mnt Something I have always wondered is what the option msdosfs stands for and more importantly, why it is necessary. (7 Replies)
Discussion started by: figaro
7 Replies

8. Filesystems, Disks and Memory

Mount USB stick...

Dummies questions, perfect for this. I cannot mount my idiotic usb stick on Slackware, I input the following on non-graphic mode as root: Mount -t vfat /dev/sdc1/usbstick usbstick is the folder i created for mounting my USB, the file system is FAT, and everytime I input that I get some kind... (2 Replies)
Discussion started by: Dax01
2 Replies

9. UNIX for Dummies Questions & Answers

Aix usb stick

I have a P-Series Machine running AIX 5.3, it has a USB Port on the front of the server, can I use a USB Stick on AIX platforms?? if so how..:rolleyes: (2 Replies)
Discussion started by: BEVAN
2 Replies

10. Linux

bootable USB Stick || Fedora 8

Hello Everybody I am planning to install Fedora core 8 on an extra PC I have; what I wanna do is to boot from a USB stick then install Fedora from an ISO image I already have via FTP. Could any one tell me how to create bootable USB Stick for Fedora as I already found how to install from FTP... (0 Replies)
Discussion started by: ahmed_nasr2001
0 Replies
Login or Register to Ask a Question