#193057 - 11/12/2003 14:41
Windows 98 shortcuts versus Windows 2000 shortcuts
|
carpal tunnel
Registered: 20/12/1999
Posts: 31600
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?
|
Top
|
|
|
|
#193058 - 11/12/2003 18:18
Re: Windows 98 shortcuts versus Windows 2000 short
[Re: tfabris]
|
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
|
|
|
|
#193060 - 11/12/2003 19:38
Re: Windows 98 shortcuts versus Windows 2000 short
[Re: tfabris]
|
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]
|
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]
|
carpal tunnel
Registered: 20/12/1999
Posts: 31600
Loc: Seattle, WA
|
Hm, that's possible, but it still doesn't explain the totally different properties boxes for the two different shortcuts.
|
Top
|
|
|
|
#193063 - 13/12/2003 04:51
Re: Windows 98 shortcuts versus Windows 2000 short
[Re: tfabris]
|
old hand
Registered: 01/10/2002
Posts: 1039
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]
|
carpal tunnel
Registered: 20/12/1999
Posts: 31600
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.
|
Top
|
|
|
|
#193065 - 14/12/2003 11:03
Re: Windows 98 shortcuts versus Windows 2000 short
[Re: tfabris]
|
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]
|
carpal tunnel
Registered: 20/12/1999
Posts: 31600
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.
|
Top
|
|
|
|
#193067 - 14/12/2003 19:34
Re: Windows 98 shortcuts versus Windows 2000 short
[Re: wfaulk]
|
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]
|
old hand
Registered: 01/10/2002
Posts: 1039
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]
|
carpal tunnel
Registered: 20/12/1999
Posts: 31600
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?
|
Top
|
|
|
|
#193070 - 17/12/2003 10:35
Re: Windows 98 shortcuts versus Windows 2000 short
[Re: tfabris]
|
old hand
Registered: 01/10/2002
Posts: 1039
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]
|
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]
|
carpal tunnel
Registered: 20/12/1999
Posts: 31600
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...?
|
Top
|
|
|
|
#193073 - 17/12/2003 11:56
Re: Windows 98 shortcuts versus Windows 2000 short
[Re: tfabris]
|
carpal tunnel
Registered: 13/07/2000
Posts: 4180
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]
|
carpal tunnel
Registered: 20/12/1999
Posts: 31600
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 ?" ?
|
Top
|
|
|
|
#193075 - 17/12/2003 12:05
Re: Windows 98 shortcuts versus Windows 2000 short
[Re: tfabris]
|
carpal tunnel
Registered: 20/12/1999
Posts: 31600
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.
|
Top
|
|
|
|
|
|