You are here

<usb onload="start.bat"> or something similar?

9 posts / 0 new
Last post
Jesdisciple
Offline
Last seen: 9 years 3 months ago
Joined: 2007-11-29 10:25
<usb onload="start.bat"> or something similar?

Would it be possible to supply a "callback"/"listener" file for PortableApps to run after the USB (or w/e) is done loading? (Sorry, DHTML is my best illustration. =P)

I tend to keep versions of files in all the computers I'm working on so some version (even if it's outdated) is always available to me. I'd like to prompt the user (myself) for which action to take: copy the USB version to the desktop location; copy the desktop version to the USB location; or leave it alone - then take the specified action.

Jesdisciple
Offline
Last seen: 9 years 3 months ago
Joined: 2007-11-29 10:25
I discovered that

I discovered that autorun.inf is the "onload attribute" of the stick, but now I wonder about the specifics (capabilities, limitations, keywords, etc.) for whatever language it's written in. (I can't find a full tutorial.) Does anyone know?

tittoproject
tittoproject's picture
Offline
Last seen: 6 years 3 weeks ago
Joined: 2005-12-09 12:23
Wikipedia

(I can't find a full tutorial.) Does anyone know?

Here some more info: http://en.wikipedia.org/wiki/Autorun

lococobra
lococobra's picture
Offline
Last seen: 16 years 7 months ago
Joined: 2007-11-29 19:31
Autorun...

Yeah, autorun's the way to do it. You won't be satisfied though. Unlike CDs, there is no way to automatically run a command as soon as the drive is loaded. No matter which way you skin this cat, there's always an intermediate step.

Here's my autorun.inf

[Autorun]
Open=LF\Launch.exe
Action=Launch PDrive
Icon=LF\Blue.ico
Label=Pocket Drive
Jesdisciple
Offline
Last seen: 9 years 3 months ago
Joined: 2007-11-29 10:25
Enter

That second enter button that's annoyingly close to the mouse pad comes in handy here. Smile But your file called my attention to Macrosoft's lack of information on their feature regarding 'label' and 'action'.

Jesdisciple
Offline
Last seen: 9 years 3 months ago
Joined: 2007-11-29 10:25
Macrosoft

Thanks titto, but that seems to be one of the more neglected Wiki articles (and I'm trying to correct that on the nearly empty talk page). This was more of what I was looking for, even though it ignores flash drives (and, contrary to what you'd expect of a company more than an encyclopedia, is incomplete): http://support.microsoft.com/kb/818804 But I'm a bit confused by the distinction between 'defaulticon' and 'icon'... *begs* A twopence of knowledge, sir? Madam?

Ed_P
Offline
Last seen: 6 years 3 months ago
Joined: 2007-02-19 09:09
_

Maybe this is more to your liking: http://msdn2.microsoft.com/en-us/library/bb776823.aspx

A link on the wiki page tittoproject posted.

I've never heard of "defaulticon" but since it is referenced on a Microsoft Visual Studio .NET page I would suspect it has something to do with .NET, which not everyone uses.

Ed

Jesdisciple
Offline
Last seen: 9 years 3 months ago
Joined: 2007-11-29 10:25
Okay, thanks Ed. That page

Okay, thanks Ed. That page looks like the one most directly intended (and most tended) for my situation.

rab040ma
Offline
Last seen: 6 months 2 weeks ago
Joined: 2007-08-27 13:35
With a lot of Microsoft

With a lot of Microsoft stuff you have to do an iterative process, like: try it, fail, lose patience, read their instructions, see a minor change, try it, fail differently, go back, read instructions again, see something different, try it but get closer. Eventually the instructions start to seem less opaque, or your research has brought you to the article that documents the difference between the way it works on NT4 versus Vista.

• defaulticon: Specifies the default icon for the application. 
• icon: Specifies the path and the file name of an application-specific icon for the CD-ROM drive.  
• open: Specifies the path and the file name of the startup application. 
• shell: Defines the default command in the shortcut menu of the CD-ROM. 
• shell\verb: Adds commands to the shortcut menu of the CD-ROM. 

I'd guess that "default icon of the application" is what icon Explorer should use for a cmd or exe file referenced in "open" that doesn't have its own icon or possibly to override it, while "icon for the CD-ROM drive" might be the icon used by explorer for the drive in My Computer. Trial and error might prove that out. It would be better if they tried harder to disambiguate their chosen words.

What would be nice is an autorun that would let one choose what would automatically run, like a process that would ignore an autorun.inf that wanted to run "MyNastyTrojan.exe" but would without complaint or prompt run any program in autorun.inf that has been code-signed by John.

You can of course come up with a variety of ways to automate the autorun on your own machine with a variety of tests before running or not running something; but it would be unlikely you could get it running on every locked down workstation you wanted to use.

MC

Log in or register to post comments