Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
AutoPlay.
#1
I am setting up computers...lots of computers...and I would like to configure them so I can have a master USB drive to make changes.
I'd like the drive to AutoPlay exe files without any prompts and eject when done.

I got it all to work on my laptop using Microsoft's "Tweak UI" PowerToy which allows you to create a new AutoPlay events.
So I plugged in the USB drive, used Tweak UI to create an AutoPlay event using the exe on the USB drive, then opened properties for the USB drive in My Computer and directed the AutoPlay options to use the AutoPlay even for all types of options. This does exactly what I want Big Grin

So now, I could go installing Tweak UI and go through the long tedious process on all machines....or I could work with the registry, that way I could run a set-up program the first time I put in the USB drive to update the registry and then every other time all I have to do is put the drive in wait for a done message and pull out. Which reminds me...is there anyway to Eject the drive when a program is done running?

I've tracked down all of the necessary locations for doing this (I think), but the problem is I cannot seem to get values to read/write from HKEY_LOCAL_MACHINE part of the registry using QM. Plus, I'm also not quite sure what some of the values should be.

From what I understand here are the things I need to do to create the AutoPlay Event:
We'll give the AutoPlay a generic name "QMAutoPlay"

Add a string with value name = "QMAutoPlay" with no value data to:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\MixedContentOnArrival
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayMusicFilesOnArrival
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayVideoFilesOnArrival
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\ShowPicturesOnArrival

Then add the values to this key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\QMAutoPlay
Action = "QM Auto Play"
DefaultIcon = "%SystemRoot%\system32\SHELL32.dll,194"
InvokeProgID = ?
InvokeVerb = "QMAutoPlay"
Provider = ?
I don't fully understand the InvokeProgID and the Provider variables. Also where does it associate that the program is on the drive? Tweak UI uses a browse where I grabbed the location off the USB drive, but in the registry it just has the program name, not even the extension. Is Tweak UI actually doing something during the AutoPlay process that I will have to write a program for as well?

Then from there it looks like I can associate the USB drive AutoPlay in the registry as well using:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\UserChosenExecuteHandlers
H:\\?\STORAGE#RemovableMedia#x&xxxxxxxx&0&RM#{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}+MixedContentOnArrival = "QMAutoPlay"
H:\\?\STORAGE#RemovableMedia#x&xxxxxxxx&0&RM#{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}+PlayMusicFilesOnArrival = "QMAutoPlay"
H:\\?\STORAGE#RemovableMedia#x&xxxxxxxx&0&RM#{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}+PlayVideoFilesOnArrival = "QMAutoPlay"
H:\\?\STORAGE#RemovableMedia#x&xxxxxxxx&0&RM#{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}+ShowPicturesOnArrival = "QMAutoPlay"
H:\\?\STORAGE#RemovableMedia#x&xxxxxxxx&0&RM#{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}+MixedContentOnArrival = "QMAutoPlay"

I'm using autorun.inf to name the drive using "LABEL= " this should work as a password to the registry, so that only USB drives with the correct label name will autoplay?
#2
After reading help file hive default 0...will play around...but this explains some of the trouble I was having.
...
Yes...that was it. Needed to add HKEY_LOCAL_MACHINE as hive. Now to just figure out those InvokeProgramID and the Provider and I'll be clipping along.
...
Does not run the program off the USB drive...but does create the AutoPlay item.
Function Function68
Code:
Copy      Help
rset("NT IT" "Action" "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\QMAutoPlay" HKEY_LOCAL_MACHINE)
rset("%SystemRoot%\system32\SHELL32.dll,194" "DefaultIcon" "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\QMAutoPlay" HKEY_LOCAL_MACHINE)
rset("QMAutoPlay" "InvokeProgID" "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\QMAutoPlay" HKEY_LOCAL_MACHINE)
rset("QMAutoPlay" "InvokeVerb" "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\QMAutoPlay" HKEY_LOCAL_MACHINE)
rset("NT IT" "Provider" "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\QMAutoPlay" HKEY_LOCAL_MACHINE)

rset("" "QMAutoPlay" "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\MixedContentOnArrival" HKEY_LOCAL_MACHINE)
rset("" "QMAutoPlay" "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" HKEY_LOCAL_MACHINE)
rset("" "QMAutoPlay" "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" HKEY_LOCAL_MACHINE)
rset("" "QMAutoPlay" "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayMusicFilesOnArrival" HKEY_LOCAL_MACHINE)
rset("" "QMAutoPlay" "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayVideoFilesOnArrival" HKEY_LOCAL_MACHINE)
rset("" "QMAutoPlay" "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\ShowPicturesOnArrival" HKEY_LOCAL_MACHINE)
...
Just wrote:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\UserChosenExecuteHandlers
H:\\?\STORAGE#RemovableMedia#x&xxxxxxxx&0&RM#{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}+MixedContentOnArrival = "QMAutoPlay"
H:\\?\STORAGE#RemovableMedia#x&xxxxxxxx&0&RM#{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}+PlayMusicFilesOnArrival = "QMAutoPlay"
H:\\?\STORAGE#RemovableMedia#x&xxxxxxxx&0&RM#{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}+PlayVideoFilesOnArrival = "QMAutoPlay"
H:\\?\STORAGE#RemovableMedia#x&xxxxxxxx&0&RM#{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}+ShowPicturesOnArrival = "QMAutoPlay"
H:\\?\STORAGE#RemovableMedia#x&xxxxxxxx&0&RM#{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}+MixedContentOnArrival = "QMAutoPlay"
to the registry...doesn't associate autoplay. There must be somewhere else that works with this....any ideas?
...
Wow...there are a lot of places in the registry where this information is written. I'm gonna need help to do this automatically without screwing things up!!
Perhaps I'll just configure the systems manually using Properties -> AutoPlay tab...not really how I want to do it...this will take me at least two days, maybe three!!
...
I still haven't actually gotten the exe to run off the USB drive.


Forum Jump:


Users browsing this thread: 1 Guest(s)