Sign in to follow this  
Followers 0
kayser2008

PenDrive Autorun

7 posts in this topic

Hello

Anyone know an automated way to replace a folder for that inserting a USB stick without using a keyboard or mouse.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Hi, kayser2008. I'm sorry, but your request does not make a whole lot of sense. Can you please explain in greater detail what it is you're looking to accomplish? Based on your thread title, are you looking to automate copying a folder from/to a usb stick when you plug it in?

Edited by JLogan3o13

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Excuse me if not well explained.

What I want is : I have a folder for example C: and I want to insert the USB be automatically overwrite the folder located at C: by teh folder that i have in my USB. witouth the use of keyboard or mouse.

Edited by kayser2008

Share this post


Link to post
Share on other sites

Microsoft did a pretty good job of disabling the AutoRun feature beginning in Windows 7 (and released an update that did the same for older OSs IIRC), so I am unsure you'll be able to do this with pure AutoIt. The only application I have run into that can autorun a USB (since moving to Windows 7 at least) is USBDLM, which basically runs as a service and looks for any USB to be connected.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

If you want to plugin a USB and autorun a program from the USB all automated, then no it can't be done.

With any luck a window will popup and from there you can start your program manually.

In any other case the program has to be installed on the computer and already be running before you plugin the USB. The program could monitor any mount points and act accordingly if a new one gets added.


[center]Spiderskank Spiderskank[/center]GetOpt Parse command line options UDF | AU3Text Program internationalization UDF | Identicon visual hash UDF

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

If you want to plugin a USB and autorun a program from the USB all automated, then no it can't be done.

With any luck a window will popup and from there you can start your program manually.

In any other case the program has to be installed on the computer and already be running before you plugin the USB. The program could monitor any mount points and act accordingly if a new one gets added.

i dont want run a program from the USB all i want is a way to replace a´folder that is on the HDD by the folder that i have on the USB by just plug a USB in to the PC.

i wose thinking that maybe the confirmation of the replacement of the folder can be done by the function MouseClick .

Edited by kayser2008

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Yes it can be done.

There are scripts on this forum that can detect newly attached drives. Then you can check that drive for a hardware ID or an expected file. Upon detection your script can than run whatever function you want. Then you just let that program sit in your tray.

That is what both dany and I alluded to; whether through USBDLM or a script as dany pointed out. The point is; there needs to be something running on the machine prior to plugging in the usb, watching for it; you cannot enable autorun so you can take the USB from machine to machine.

Edited by JLogan3o13

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0