Short-cut creator

  • Thread starter Thread starter JimmyJam
  • Start date Start date
After thinking about it, I can come up with examples. The msie -nohome
switch in explorer context menu. Or msiexec.exe (for .msi) it does
extra switches, such as /i "%1" %* . Sure I could now come up with a
list. Point of correction being, no generalization possible about not
being able to set up GUI progs with their extra switches.

Just, for this =particular= situration, it became necessary to treat
it the same way as a DOS/CLI thing. I do not understand =why= that
approach was needed here.


Jason, I know that's a big hassle, to do the above. But if you're
willing, can you tell me if you get the same results I do?

I'd be happy to. Today is pretty crazy though, so it'll have to be
either tonite or tomorrow. I'd do it right now, but I'd have to figure
out what to do, since I don't use bats and pifs very often.
 
Jason,

I had the same experience. I am still playing with quotes and such to see
what the problem is. What OS are you using? Perhaps that is relevant. I
am still using Win98SE.
 
For the sake of completeness, perhaps we should post instructions on adding
actions for filetypes.
 
omega said:
Jason, I know that's a big hassle, to do the above. But if you're
willing, can you tell me if you get the same results I do?

Okay, I made a bat file. I think the syntax is OK, but you can correct
me:

@ECHO OFF
C:\Program Files\mozilla.org\Mozilla\mozilla.exe
EXIT

Then, I made a piffile I inserted this command line:

"C:\Program Files\mozilla.org\Mozilla\mozilla.exe" -nosplash -edit %1 %2
%3 %4 %5 %6 %7 %8 %9

Then, I placed the piffile in the sendto folder.

It gave me a document in browser mode, not edit mode.
 
Way to go Karen!!! I'd rather have an entry in my Explorer context menu
than use the sendto menu anyway. So this is the perfect solution for me.
Why don't you simply drop the "-browser" altogether. In your
preferences set Mozilla to open only the browser as the standard
operation.

The file:// may or may not be required with the %1.
 
Okay, I made a bat file. I think the syntax is OK, but you can correct
me:

@ECHO OFF
C:\Program Files\mozilla.org\Mozilla\mozilla.exe
EXIT

Then, I made a piffile I inserted this command line:

"C:\Program Files\mozilla.org\Mozilla\mozilla.exe" -nosplash -edit %1 %2
%3 %4 %5 %6 %7 %8 %9

Then, I placed the piffile in the sendto folder.

It gave me a document in browser mode, not edit mode.

You need to edit the Mozilla line in your batch file to include the
" %1 %2 %3 %4 %5 %6 %7 %8 %9" parameters. This would allow the
passing of parameters such as the -edit and -nosplash. The filename
passed would end up as %3 in that particular case.
 
David said:
You need to edit the Mozilla line in your batch file to include the
" %1 %2 %3 %4 %5 %6 %7 %8 %9" parameters. This would allow the
passing of parameters such as the -edit and -nosplash. The filename
passed would end up as %3 in that particular case.
Okay, I think I get what you say. I modified the batfile to read:

@ECHO OFF
C:\Program Files\mozilla.org\Mozilla\mozilla.exe %1 %2 %3 %4 %5 %6 %7 %8 %9
EXIT

As before, the command line in the piffile reads:

"C:\Program Files\mozilla.org\Mozilla\mozilla.exe" -nosplash -edit %1 %2 %3
%4 %5 %6 %7 %8 %9

When I do a sendto, I get the same result as before. The file opens in
browser mode. :(
 
Okay, I think I get what you say. I modified the batfile to read:

@ECHO OFF
C:\Program Files\mozilla.org\Mozilla\mozilla.exe %1 %2 %3 %4 %5 %6 %7 %8 %9
EXIT

As before, the command line in the piffile reads:

"C:\Program Files\mozilla.org\Mozilla\mozilla.exe" -nosplash -edit %1 %2 %3
%4 %5 %6 %7 %8 %9

When I do a sendto, I get the same result as before. The file opens in
browser mode. :(

The only suggestion I can make is to include each of the %n in its own
set of inverted commas. e.g. "%1" "%2" etc.

In DOS the above would have worked but MS have been changing things so
much that I have not bothered to keep up.

You could also try putting the -nosplash in the batch file and/or
having a separate batch file for the edit function with the -edit as
part of the command line.

Try invoking the batch file from the sendto: rather than the .pif
file.

Best of luck.
 
David Simpson said:
Try invoking the batch file from the sendto: rather than the .pif
file.

I haven't followed up on this thread yet, until I sit down for a few
more tests. But this last part I can easily comment offhand. I cannot
put .bats in my sendto, and must use .pifs. The reason is that their
default handler is a text editor. I think this config is pretty common.

Default handler of .bat as notepad becomes ever more important for those
who have jealous pets in the household. <g> I used to have pets who would
mess with my keyboard and mouse, as revenge, whenever they felt their
high physical attention requirements were not being met. Given all the
destructive .bats one might have stored over time (format c:, deltree *
etc), I found it an important safety measure, to not let my pets be able
to just hit the enter and set em off.

The one thing I saw higher up in the thread was that Jason had added a
switch to the .pif. I've never done that, so don't know what the story
is there. I add switches to the bat itself, then leave the command in
the pif basic.

Again, I still have to sit down to test again, about it working/not working
for launch of a startup mode different than what is configured in the Mozilla
preferences. Testing for curiosity alone. For actual end goal, I saw Jason
preferred to have the command in his explorer menu...where he did get good
results.
 
David said:
jason typed furiously:

The only suggestion I can make is to include each of the %n in its own
set of inverted commas. e.g. "%1" "%2" etc.

Tried that, no luck.
In DOS the above would have worked but MS have been changing things so
much that I have not bothered to keep up.

You could also try putting the -nosplash in the batch file and/or
having a separate batch file for the edit function with the -edit as
part of the command line.

I tried the switches in the batch file, again no luck.
Try invoking the batch file from the sendto: rather than the .pif
file.

I tried that too, no luck.

As for the piffile, I can't claim a 100% accurate test, since I was also
trying Karen's suggestion of changing the batfile at the same time. I
*think* I tried every conceivable combination of pif and batfile, but I
can't say for sure.
 
omega said:
Default handler of .bat as notepad becomes ever more important for
those who have jealous pets in the household. <g> I used to have pets
who would mess with my keyboard and mouse, as revenge, whenever they
felt their high physical attention requirements were not being met.
Given all the destructive .bats one might have stored over time
(format c:, deltree * etc)...
LMAO!

The one thing I saw higher up in the thread was that Jason had added a
switch to the .pif. I've never done that, so don't know what the story
is there. I add switches to the bat itself, then leave the command in
the pif basic.

I tried the piffile both with and without switches. Like I told David,
I'm not 100% sure I tested every conceivable combination of pif and
batfile, but I *think* I tested most of them.
For actual
end goal, I saw Jason preferred to have the command in his explorer
menu...where he did get good results.

Yep, I have my solution. :) So this other stuff is just in the spirit of
exploration.
 
I haven't followed up on this thread yet, until I sit down for a few
more tests. But this last part I can easily comment offhand. I cannot
put .bats in my sendto, and must use .pifs. The reason is that their
default handler is a text editor. I think this config is pretty common.
OK. Invoke the .bat with "command" instead. e.g. "Command edit.bat %1
%2 ... "
 
jason said:
I tried the piffile both with and without switches. Like I told David,
I'm not 100% sure I tested every conceivable combination of pif and
batfile, but I *think* I tested most of them.

I've now got the batch thing worked out. I've tested in every possible
Mozilla scenario I could imagine. Tested with multi-profile, and their
various settings. Tested again, after finding a way to revert to Mozilla
default config (by hiding from it that registry.dat file it looks for over
in the %appdata% folder, which tells it where to find out about any
profiles). Tested variations of startup settings (those chosen in edit>
preferences> appearances> mozilla starts up with> navigator, mail, etc).
Tested with the -turbo quicklaunch thing, which has the mozilla.exe kept
on as a running process. I am satisfied that it works. For w98 at minimum.

Here is the bat file:

start mozilla.exe -nosplash -edit "%1"

(That %1 %2 %3 etc variable works too, but turned out unneeded, after all.)

Where I've put "start mozilla.exe" you can substitute with the full path
to mozilla.exe. But then make sure it's in quotes, in case you have spaces
in that path.

Or you can do what I did, put an .lnk somewhere in your path, which points
to your mozilla executable. This enables you to just type the name only.
When creating shortcuts, you are able to type just the name there, as well
(Windows silently auto-adds the path). And on the run command, and in file
protocol, too, but that part's not applicable here. Actually, Jason, I think
you already know this, distant memory is that you once discussed it, to some
extent. But not specifically with batch files. So, it's the form above works;
calling "start" in the batch is needed if using the .lnk trick.

Anyway, you would use the bat file above. Either with having done the .lnk
thing, else with full path to mozilla.exe. Then do the right-mouse drag on
the bat file, choosing create shortcut, to give you a .pif linked [*] to it.
Drop the pif into your sendto folder. On the pif properties, choose close on
exit, run minimized, pretty icon.

[*The way the pif manager steps in when we create a shortcut to our batches,
that's probably a w9x thing. I'm not going to worry right now by trying to
think about the variation with shortcuts to batch files in the NT system.]

Jason, actually, this time I don't have as high a need as before to impose
on you to try the test. It helped a lot that you did so earlier; resulted
in my taking a better look, cleaning up some of my initial inaccurate
guesses, and find out how Mozilla wants to be called up in the various
situations. Especially not worth your hassle now that it's not a something
you need on your system, this in sendto.

Only time might be somewhere in the future, were you to decide to give the
Moz composer a demotion. I tend to keep my most frequently-used commands in
the explorer menu. And then in my sendto menu, a lot more stuff (including
new apps). Sendto has that nested folders thing going for it, and doesn't
get to feeling overcrowded as quickly as the explorer menu.
 
jason said:
Yep, I have my solution. :) So this other stuff is just in the spirit of
exploration.

Well, I locked myself in a room with the lizard, and told him I wouldn't
let him out until he explained to me exactly what he wanted.


For the Explorer context-menu (html filetype actions):

composer:
mozilla.exe -nosplash -edit "%1"

navigator:
mozilla.exe -nosplash -url "%1"

kiosk:
mozilla.exe -nosplash -browser "file://%1"



For the Sendto. It does !not work with regular shortcuts (.lnks) there,
ignores any parameters. This was strange and unexpected for me. Where
it does work is when a batch file is used, instead of an .lnk.

composer:
start mozilla.exe -nosplash -url "%1"

navigator:
start mozilla.exe -nosplash -edit "%1"

kiosk:
(negative)



Now, regular shortcuts, when you have them set to certain document, instead
of needing a placeholder (%1), those do work fine. Put the full line in the
Run dialog, or in whatever menu system you use, or create shortcut .lnks.

composer view file:
mozilla.exe -nosplash -edit "path\file.htm"

composer view remote file (+ have moz in quicklaunch mode):
mozilla.exe -turbo -edit www.google.com

navigator view file:
mozilla.exe -nosplash -url "path\file.htm"

navigator view remote file (+u se a specific profile)
mozilla.exe -nosplash -url -p "profile_Name" www.google.com

kiosk mode present file:
mozilla -nosplash -browser file://"path\presentation demo.htm"


Other types of launch:

news, read newsgroup:
mozilla -news news://server/group
mail, hello to foo:
mozilla -mail mailto:[email protected]?subject=hello


Many more at <http://www.mozilla.org/docs/command-line-args.html>

That's the doc I used. It's pub May 2003. I don't know if there are important
updates. That one, it could do with a change to the description of the
-browser switch. And it should make mention of the -url switch. In case
not clear why the -url switch: it is needed for instance when one's one's
preference settings are to normally start up in some other mode, such as
composer or news.

.. . .

As to that main thing here for my own learning, my big surprise, to get
informed how the normal links, their switches, did not work in the sendto,
and that Moz required being talked to more like a DOS\CLI animal for that
area, well, just have to ponder for a while... (I might end by taking time
to dig through my registry and see if there are any there GUI apps that
also have this weird twist, during sendto placement. Or whether it's more
a Moz thing only.)
 
composer:
start mozilla.exe -nosplash -url "%1"
navigator:
start mozilla.exe -nosplash -edit "%1"


Typo above. Should be reversed, though that's probably easy to spot.
What I'm really posting to append here (had forgotten to do so) was
that my testing was w98 + moz 1.6.
 
For the Explorer context-menu (html filetype actions):

composer:
mozilla.exe -nosplash -edit "%1"

navigator:
mozilla.exe -nosplash -url "%1"

kiosk:
mozilla.exe -nosplash -browser "file://%1"
<snipped the rest of this post only for brevity. If you have any interest
AT ALL in Mozilla, read the whole thing!

WOW. Thanks Karen for your huge effort on this. Man, that "url" one is
not obvious!
 
omega said:
I've now got the batch thing worked out. I've tested in every possible
Mozilla scenario I could imagine. Tested with multi-profile, and their
various settings. Tested again, after finding a way to revert to
Mozilla default config (by hiding from it that registry.dat file it
looks for over in the %appdata% folder, which tells it where to find
out about any profiles). Tested variations of startup settings (those
chosen in edit> preferences> appearances> mozilla starts up with>
navigator, mail, etc). Tested with the -turbo quicklaunch thing, which
has the mozilla.exe kept on as a running process. I am satisfied that
it works. For w98 at minimum.

Here is the bat file:

start mozilla.exe -nosplash -edit "%1"

This first one didn't work for me:

start C:\Program Files\mozilla.org\Mozilla\mozilla.exe -nosplash -edit "%1"
Where I've put "start mozilla.exe" you can substitute with the full
path to mozilla.exe. But then make sure it's in quotes, in case you
have spaces in that path.

Adding in the quotes worked. Strange, given that I didn't have spaces in
the path. Anyway, here's the batfile that worked:

start "C:\Program Files\mozilla.org\Mozilla\mozilla.exe" -nosplash -edit "%
1"

This is way cool. Now I have two ways of getting to edit -- thru the
Explorer context menu or sendto.

Many thanks! You deserve a medal for all the work you've done on this. :)
 
jason said:
WOW. Thanks Karen for your huge effort on this.

Jason, your very kind words, left me almost too embarrassed to reply.
But I must, to again thank you: for getting me to clear up my initial
series of inaccuracies about shortcuts (.lnks) with Mozilla, and to
at last get something of a hold on what does work there. Until they
change things, of course...
 
omega said:
Jason, your very kind words, left me almost too embarrassed to reply.
But I must, to again thank you: for getting me to clear up my initial
series of inaccuracies about shortcuts (.lnks) with Mozilla, and to
at last get something of a hold on what does work there. Until they
change things, of course...

Hey, always glad to help. You've been doing so much ground-breaking stuff
here, it's the least I could do. :)
 
Back
Top