Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#193057 - 11/12/2003 14:41 Windows 98 shortcuts versus Windows 2000 shortcuts
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31578
Loc: Seattle, WA
I have a batch file which processes the command line parameter as "%1", allowing me to pass information into the batch file via the command line. Standard stuff.

When I create a shortcut to the batch file in Windows 98 (and all prior versions of Windows if I recall correctly), I can edit the properties of the shortcut and place a question mark on the command line to the batch file.

The question mark is interpreted by Windows, preprocessed before execution. When I doubleclick on the shortcut, Windows stops and puts up an interactive dialog box where I can enter the parameter I want in place of a question mark. Then it runs the program with that parameter.

Thus, allowing me to change the parameter to the batch file interactively from a Windows interface. Neat.

Another thing I can do with the properties of that shortcut is choose to check or to uncheck the option that reads "Close on exit". This allows me to choose whether or not the batch file's window will disappear when it's done running.

Okay, so far so good. The above is just background... Anyone who's messed with batch files enough in Windows knows about that stuff.

But here's where it gets interesting:

In Windows 2000, if I create a shortcut to that batch file, it does not honor the question mark as an interactive prompt, it merely passes a question mark to the batch file as the parameter. AND... It doesn't offer me the "Close on Exit" option, either.

So Windows 2000 has simply removed those features, right? Not quite. It gets even more interesting here:

If I copy the shortcut file created in Windows 98 onto Windows 2000, then run that shortcut file, it works, and when I edit the properties of the shortcut I see all of the options that I had originally seen in Windows 98.

Although it's a bit buggy. My command line gets truncated if it's too long (I had to edit "Program Files" to "Progra~1" to get it to fit), and one of the fields in the properties box was garbage characters (those square symbols you see when high ascii is displayed in a Windows dialog box).

Anyone know what's going on here, and if there is a way I can create this "old style" shortcut natively in Windows 2000?
_________________________
Tony Fabris

Top
#193058 - 11/12/2003 18:18 Re: Windows 98 shortcuts versus Windows 2000 short [Re: tfabris]
g_attrill
old hand

Registered: 14/04/2002
Posts: 1172
Loc: Hants, UK
I briefly tried to do this a couple of weeks ago and was also stumped. I have just done a google search and come up with this:

http://groups.google.com/groups?th=4cf103593287e674

Not a fix but a workaround.

Gareth

Top
#193059 - 11/12/2003 18:39 Re: Windows 98 shortcuts versus Windows 2000 short [Re: g_attrill]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31578
Loc: Seattle, WA
The link from that discussion thread that supposedly points to the work around failed when I clicked on it. Oh well.
_________________________
Tony Fabris

Top
#193060 - 11/12/2003 19:38 Re: Windows 98 shortcuts versus Windows 2000 short [Re: tfabris]
ricin
veteran

Registered: 19/06/2000
Posts: 1495
Loc: US: CA


Edited by ricin (11/12/2003 19:47)
_________________________
Donato
MkII/080000565
MkIIa/010101253
ricin.us

Top
#193061 - 12/12/2003 10:01 Re: Windows 98 shortcuts versus Windows 2000 short [Re: tfabris]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
Is it possible that it's a difference between cmd.exe and command.com? The Win98 shortcut would be referencing the latter, while the Win2k one would not.
_________________________
Bitt Faulk

Top
#193062 - 12/12/2003 12:39 Re: Windows 98 shortcuts versus Windows 2000 short [Re: wfaulk]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31578
Loc: Seattle, WA
Hm, that's possible, but it still doesn't explain the totally different properties boxes for the two different shortcuts.
_________________________
Tony Fabris

Top
#193063 - 13/12/2003 04:51 Re: Windows 98 shortcuts versus Windows 2000 short [Re: tfabris]
larry818
old hand

Registered: 01/10/2002
Posts: 1033
Loc: Fullerton, Calif.
As you probably know, under win2K, if you ceate a shortcut to an executable (.exe) file, you get more control propertites than if you create a shorcut to a .bat file. One way I've worked around this is to create my shortcut to some random .exe file, then modify the propertites to point to my .bat file. You'll retain all the control associated with the .exe profile.

Hope this helps in your case.

Top
#193064 - 13/12/2003 12:16 Re: Windows 98 shortcuts versus Windows 2000 short [Re: larry818]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31578
Loc: Seattle, WA
This technique, when I tried it just now, did not produce a set of options that were any different than I would get by creating the shortcut directly to the batch file. Perhaps I was doing it wrong.
_________________________
Tony Fabris

Top
#193065 - 14/12/2003 11:03 Re: Windows 98 shortcuts versus Windows 2000 short [Re: tfabris]
lectric
pooh-bah

Registered: 20/01/2002
Posts: 2085
Loc: New Orleans, LA
Have you tried creating a .pif instead? ISTR this works, but I don't have a win2k box handy at the moment to test with.

Top
#193066 - 14/12/2003 11:39 Re: Windows 98 shortcuts versus Windows 2000 short [Re: lectric]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31578
Loc: Seattle, WA
Have you tried creating a .pif instead?
I thought that when you created a shortcut to a batch file, that WAS a .pif. I thought you only get .lnk files when you create shortcuts to Windows EXEs or registered document types.

How would you go about creating a .pif specifically? I don't know where or how to specify which thing I'm creating. The only way I ever knew how was: Shortcuts to windows programs and documents were LNKs, shortcuts to batch files and DOS programs were PIFs.
_________________________
Tony Fabris

Top
#193067 - 14/12/2003 19:34 Re: Windows 98 shortcuts versus Windows 2000 short [Re: wfaulk]
Mataglap
enthusiast

Registered: 11/06/2003
Posts: 384
In reply to:

Is it possible that it's a difference between cmd.exe and command.com?




Yes, command is more or less the 16 bit DOS command interpreter, where as cmd.exe is the 32bit version for WinNT based systems. Most of the time the differences don't matter, but sometimes they do.

--Nathan

Top
#193068 - 16/12/2003 10:07 Re: Windows 98 shortcuts versus Windows 2000 short [Re: tfabris]
larry818
old hand

Registered: 01/10/2002
Posts: 1033
Loc: Fullerton, Calif.
I tried it just before posting to be sure I wasn't high, and tried it again just now. I have two shortcuts, both pointing to the same .bat file. The one created to the .bat shows tabs for genera/shortcut/options/font/layout/colours/security. The one created to an .exe and then edited to the .bat shows tabs for memory/screen/misc/general/summary/security/program/font. Usually it's the memory and screen stuff I want to control.

Top
#193069 - 16/12/2003 10:18 Re: Windows 98 shortcuts versus Windows 2000 short [Re: larry818]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31578
Loc: Seattle, WA
Do either of those options show the feature "Close On Exit", or do either of them allow you to place a question mark on the command line and get a Windows prompt for the parameters?
_________________________
Tony Fabris

Top
#193070 - 17/12/2003 10:35 Re: Windows 98 shortcuts versus Windows 2000 short [Re: tfabris]
larry818
old hand

Registered: 01/10/2002
Posts: 1033
Loc: Fullerton, Calif.
Yes it does, I've just tested it. However, I found out that the shortcut with expanded capabilities has to first be made to a dos app, if you make it to a winders .exe file, you won't get these options.

Top
#193071 - 17/12/2003 10:36 Re: Windows 98 shortcuts versus Windows 2000 short [Re: larry818]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
Thus, cmd vs. command.
_________________________
Bitt Faulk

Top
#193072 - 17/12/2003 11:47 Re: Windows 98 shortcuts versus Windows 2000 short [Re: wfaulk]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31578
Loc: Seattle, WA
Thus, cmd vs. command.
But "Command" doesn't exist on a fully Windows-NT system. It only exists on a dual-boot system with Dos and NT.

At least, I thought that was the case...?
_________________________
Tony Fabris

Top
#193073 - 17/12/2003 11:56 Re: Windows 98 shortcuts versus Windows 2000 short [Re: tfabris]
peter
carpal tunnel

Registered: 13/07/2000
Posts: 4174
Loc: Cambridge, England
But "Command" doesn't exist on a fully Windows-NT system. It only exists on a dual-boot system with Dos and NT.
c:\winnt\system32\command.com

Peter

Top
#193074 - 17/12/2003 11:59 Re: Windows 98 shortcuts versus Windows 2000 short [Re: peter]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31578
Loc: Seattle, WA
Interesting!

So that's the secret, then? Make sure that the shortcut is for command instead of CMD?

So instead of pointing directly to the batch file, I point the shortcut to "command.com batchfile ?" ?
_________________________
Tony Fabris

Top
#193075 - 17/12/2003 12:05 Re: Windows 98 shortcuts versus Windows 2000 short [Re: tfabris]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31578
Loc: Seattle, WA
Hmm. Not quite. The shortcut properties work, but it doesn't run the batch file and instead displays an error message. There's a field for "Batch File" but it doesn't seem to do anything.

Interesting thing is, when I edited the shortcut properties to add "command.com", saved the changes, exited the properties panel, and went back in, it said "this is not a valid shortcut". But then ten seconds later, it worked and had the new properties page.
_________________________
Tony Fabris

Top