You are here

My current method for starting up all of my portableApps.

21 posts / 0 new
Last post
Theborg3of5
Offline
Last seen: 15 years 11 months ago
Joined: 2007-09-22 13:20
My current method for starting up all of my portableApps.

Hey everyone!

I thought I'd post on here just how I launch/use my USB workspace, in case it might help anyone.

First, I have my autorun file reference a special "starter.exe" that I've created from scratch with a .bat file (NOTE: I turned it into a .exe with an aptly named little app called BAT to EXE converter (Here)...I use the icons for those .exe's that I extract from the programs, etc. with BeCyIconGrabber, found Here.):

starter.bat
@echo off
start /wait PortableApps\Pstart\PStart.exe
start G:\PortableApps\Pstart\PStart.exe

This starts up Pstart from whatever letter my flash drive is on, and then this script pauses and waits (via the /wait) until Pstart is closed to execute the next command. From there, I activate the first item in my Pstart list: Basically, the item references "%system%\subst.exe" with added arguments "G: %pdrive%\". Basically, what this does, is use subst.exe in the C:\WINDOWS\SYSTEM32 folder (referenced by pstart as the variable %system%), to set the drive G: to the same as my flash drive's current letter.

What this means is that now, I can use the G: drive as my permanent drive letter for any apps/commands that need it, on any computer, as long as I run that item first. I have Pstart set to close when it runs that specific item (this option is found in the advanced tab of the options for the individual item), starter.exe finishes waiting, and launches Pstart again, this time off of the G: drive, so that everything that i'm working with is on the G: drive.

One of the many advantages of working purely on the G: drive is that now, I can use HotKeyz to reference any of my portable apps, simply by using G:/their path, and not worry about the drive letter changing.

I have, for instance:

  • FirefoxPortable set to ctrl+shift+alt+F
  • A little script that I found that hides or shows hidden files in windows explorer (see Here at Lifehacker) set to ctrl+shift+alt+H
  • The G: drive's folder set to ctrl+shift+alt+E (quite handy!)
  • The Control Panel set to ctrl+shift+alt+C
  • The volume control (the full one, where I can change the WAV volume as well as the main Volume [which is, by default, controlled with WindowsKey+Up arrow and Down arrow, Muted with WindowsKey+Enter]), set to ctrl+shift+alt+V.

And of course you can reference just about anything else and bind it to a hotkey with hotkeyz as well. ^^.

When I'm finished, I use ejectUSB.exe (to which my shortcut via hotkeyz is ctrl+shift+alt+X), which gets rid of the extra G: drive. (Here, with a few tweaks to the .ini file, such as telling it not to try and actually eject the drive.)

I also keep .exe's that are shortcuts to certain programs (like the PAM(R30), Pstart, FirefoxPortable, my Starter.exe script, and nDroid (Here.), my current favorite search and run app.), so that I have a quick way of starting my most needed programs if i need to quickly say, sit down, get on firefox, and then leave.

In any case, that's basically the extent of my flash drive's inner workings. Feel free to comment about how things could be made easier, any improvements made, or if you have any questions, and i'll help to the best of my ability.

ottosykora
Offline
Last seen: 1 day 8 hours ago
Joined: 2007-10-11 17:48
when G is existing

what does then happen exactly?
I mean, that there is G assigned an a computer is very likely during boot up, so this has to kick that one out to other drive letter and ??

or do I understand something wrong?

Otto Sykora
Basel, Switzerland

m2
Offline
Last seen: 13 years 11 months ago
Joined: 2006-12-12 12:00
Then the whole thing doesn't

Then the whole thing doesn't work, you can't kick a letter out that easily...fortunately.
A correct way of doing this is:

set drive_letter=%~d0
set drive_letter=%drive_letter:~0,1%
start %drive_letter%:\PortableApps\Pstart\PStart.exe

"Those people who think they know everything are a great annoyance to those of us who do." Asimov

EspaÑaks (not verified)
could u explain that commands

could u explain that commands better?

m2
Offline
Last seen: 13 years 11 months ago
Joined: 2006-12-12 12:00
http://www.robvanderwoude.com

"Those people who think they know everything are a great annoyance to those of us who do." Asimov

ottosykora
Offline
Last seen: 1 day 8 hours ago
Joined: 2007-10-11 17:48
that is why I was asking

that is why I was asking him how this all should work reliably. Using it on same laptop all the time all might be simple, but flexibility and portability must go further then just assigning a fixed drive letter which might be usually not occupied.
But as the first free letter under windows is O: on my home desktop, only things with ~d0 have some chance to work.

Otto Sykora
Basel, Switzerland

m2
Offline
Last seen: 13 years 11 months ago
Joined: 2006-12-12 12:00
Yep...at my university, the

Yep...at my university, the first free is F IIRC...but network drives take T..Z.
One can simply never assume that particular letter is never in use.

"Those people who think they know everything are a great annoyance to those of us who do." Asimov

Skate6566
Skate6566's picture
Offline
Last seen: 15 years 6 months ago
Joined: 2008-08-20 11:00
Drive letter "Z" can be

Drive letter "Z" can be safely assumed to not be taken, and you have the option to use that if you use Truecrypt.

--Skate6566

m2
Offline
Last seen: 13 years 11 months ago
Joined: 2006-12-12 12:00
Yeah, my last post proves

Yeah, my last post proves that it can't....

"Those people who think they know everything are a great annoyance to those of us who do." Asimov

Theborg3of5
Offline
Last seen: 15 years 11 months ago
Joined: 2007-09-22 13:20
No, you're completely

correct on your interpretation...this was simply a short-term solution for my problem.

Luckily, I moved on to a keyboard-based program/document launcher (Executor: here! and article about it on lifehacker: here.) which supports hotkeys for its items, and can be made quite portable. So I may be moving away from this shortly.

I would highly recommend Executor to anyone who uses Launchy, nDroid, Find and Run Robot, etc.

App Guy
Offline
Last seen: 11 years 2 months ago
Joined: 2008-03-16 14:24
Could I see

Could I see the bat file you used to make your program? It is a nice idea.

May the Shwartz be with you

Theborg3of5
Offline
Last seen: 15 years 11 months ago
Joined: 2007-09-22 13:20
The bat file...

Is posted above, I believe. Or were you referring to a different one?

gluxon
gluxon's picture
Offline
Last seen: 4 years 4 months ago
Developer
Joined: 2008-06-21 19:26
Nice.

Did you happen to do part of this with the page I linked here?

https://portableapps.com/node/15869

Guess that post useless after all Blum

Theborg3of5
Offline
Last seen: 15 years 11 months ago
Joined: 2007-09-22 13:20
Yes,

I do believe that's where I pulled that method from, thanks for posting that link!

abushcrafter
abushcrafter's picture
Offline
Last seen: 14 years 4 months ago
Joined: 2008-05-12 13:39
I love this Little app! It

I love this Little app! It just doe's the job really well Smile

http://www.tarma.com/index.htm#/products/autorun/index.htm

gregnorris
Offline
Last seen: 13 years 5 months ago
Joined: 2008-10-23 16:30
I may be good with computers but

I may be good with computers but, I'm still a bit confused. Could you me a step by step instruction on how I could create an autorun that set's my drive to K on all computers I run on. That would work on most all computers I use and presumably with my home computer where I set certain programs to run from the K-Drive. (Such as emulators and such I wanted to take with me and remove from my relatively small home drive.) Also is there any workaround to having to manually remove the extra drive, like something being triggered when I use the standard "safely remove Hardware" button. I use a Windows XP computer 90+% of the time and since I must be leaving soon my email you can contact me at is gregoryrnorris@yahoo.com and make the subject something obvious so I don't accidentally delete your emails. Thanks in advanced and sorry for being long winded.

Theborg3of5
Offline
Last seen: 15 years 11 months ago
Joined: 2007-09-22 13:20
Sure!

Hey Greg:

Sorry for the late reply! I don't get onto that particular topic page often.

As mentioned on the comments on the page, you do need to be sure that the K:\ drive is free on all machines you will be using, otherwise this may simply not work on those machines with the drive letter taken.

Anyway.

First off, I use Pstart to do this. So if you don't have Pstart, go get it and install it on your flash drive somewhere. In my example, I installed it to G:\PortableApps\ . I create an item in pstart by going to Edit->Add File. In this browse window, I navigate to C:\WINDOWS\SYSTEM32, and pick subst.exe from that folder (or, just paste the following into the 'file name' box: C:\WINDOWS\SYSTEM32\subst.exe ). You now should be in a 'file properties' window, with fields such as name, application/file path, Command line parameters, etc. The ones we're interested in are the Application / File path field and the Command line parameters field.

The Application field should already be filled, with "C:\WINDOWS\SYSTEM32\subst.exe". The Command line parameters field should be filled with "K: %pdrive%\", where K: is the drive that you want your drive to always be set to, and the %pdrive% is a special variable that pstart uses to reference the drive letter that your flash drive is actually starting with when you plug it in.

From there, head over to the "advanced" tab in the same window, and change the 'on execution' drop-down to 'run and exit application'. Then hit 'ok'.

Now you have an item in pstart which will change your drive from whatever it is to K:\ and then exit Pstart.

Next, we make our starter file.

Create a new text file and name it "starter.bat" or something similar: you can really name it anything, just make sure it ends with '.bat' and remember the name of the file.

The file should contain the following:

@echo off
start /wait PortableApps\Pstart\PStart.exe
start K:\PortableApps\Pstart\PStart.exe

What that will do is start Pstart and wait for it to close, then start pstart again from the K:\ drive. Once pstart closes (which it will when you use that item we just created to subst the drive), it will open the K:\ version of pstart. From that version of pstart, you can start programs from there as usual. I used it particularly because I use pstart to start up several little portable applications like pnotes portable, pidginportable, firefoxportable...etc. and they would all be on the drive i wanted them to be on.

Anyway, now, in order to get this to run when you plug in your drive, we need to create/edit your autorun.inf file, which will be in K:\ or whatever the drive letter is at the moment, possibly hidden. (if you suspect it's hidden, go to Tools->Folder Options and click the View tab, and click 'show hidden files and folders').

Once you've located your autorun.inf file (or if one doesn't exist, just create a new text file and save it as autorun.inf in the place where autorun.inf should be) and put the following into it:

[autorun]
start PortableApps\Pstart\PStart.exe

This will start pstart when you plug the drive in.

From there, whenever you plug in the drive, just let pstart come up and double click on the item we created. Pstart will subst the drive (which basically means that it's both whatever it started as and K: at the same time, use either letter.), close, and then open again from K:\. Anything you now open from pstart will be on the K: drive, and you can simply explore to the K: drive to open other apps from there.

That's all, folks!

jsaul
Offline
Last seen: 16 years 2 months ago
Joined: 2008-10-28 14:46
How do you get your USB to autorun?

I have been trying for days to find out how to get a program to autorun when I plug my flash drive in a computer. Everything that I have read has said that a USB flash drive cannot autorun because it is considered a removable drive by the OS. According to my previous research, only U3 smart drive are able to use autorun.inf. So, I was very excited to find your post. I tried to do the steps as you indicated and it still does not autorun. Can you please explain to me in DETAIL how you got this to work? I must be doing something wrong or am I misunderstanding your meaning of "autorun file"? Any guidance you can give me will be GREATLY appreciated! Thanks!

ottosykora
Offline
Last seen: 1 day 8 hours ago
Joined: 2007-10-11 17:48
jsaul

>you got this to work? I must be doing something wrong or am I misunderstanding your meaning of "autorun file"? Any guidance you can give me will be GREATLY appreciated! Thanks!

Otto Sykora
Basel, Switzerland

abushcrafter
abushcrafter's picture
Offline
Last seen: 14 years 4 months ago
Joined: 2008-05-12 13:39
Just use this!
Theborg3of5
Offline
Last seen: 15 years 11 months ago
Joined: 2007-09-22 13:20
Jsaul:

Autorun is a Windows service which may be disabled on some machines, especially those within companies and at schools. Any removable drive should be able to autorun, it simply needs an autorun.inf file in the root of the drive (X:\, G:\, whatever.) that reads:

[autorun]
start ...

where the ... is the absolute or relative path to whatever you want run when the drive starts.

Try creating that file (just create a new text file and save it to the root of the drive as autorun.inf) and see if it works...if not, autorun may be disabled on that machine.

Oh, and I'm using Windows XP (SP3 and SP2 on different machines) on almost all of my machines.

Log in or register to post comments