Solved

command com for 98 , ME and 2000

Posted on 2001-06-26
27
289 Views
Last Modified: 2013-12-28
Hi

what is the diiference bet. the command com in 3 above.

I am working on a program that uses command com to run some java program.

98 and ME is using ms-dos promt while 2000 is using command com I thk.

Do I need to change the command for the 3 diiferent platform?  Is there one that interface with the 3 .

Can I use 2000 command com on win98?
Is ME and 98 the same command com?
0
Comment
Question by:TLTEO
  • 14
  • 11
  • 2
27 Comments
 
LVL 10

Expert Comment

by:tonnybrandt
Comment Utility
Actually win 98 and me is using command.com. Msdos prompt is only a "shortcut" to command.com.
You can also use command.com in win2000. It interacts with the normal command interpreter cmd.exe.

You should be fine , just using the command.com that is built in these OS'es, without having to use a specific one.
0
 

Author Comment

by:TLTEO
Comment Utility
2000  seems to be using command prompt. It all looks the same, but if I want to execute a file like

start mypic.jpg          in 98  it works

in 2000 what do i do?   Is ity the same as NT?


I am not too sure about windows.  

How come my MSDOS promt is only about 16 lines to use, but ME and 2000 have about 50 lines,  I mean in the size of the viewable screen.


Also,  how can I solve the problem of DOS 8.3.

Seems 2000 command promt can see a directory longer than 8 characters. But dos in 98 cannot, extra will be trancated.
It is giving me problem.

0
 
LVL 10

Expert Comment

by:tonnybrandt
Comment Utility
>>Start mypic.jpg

This works in win2000. You just have to be sure that the filetype jpg is associated with a program, and it will start. So will it in all other windows versions, except windows 3.1/3.11

>>How come my MSDOS promt is only about 16 lines to use, but ME and 2000 have about 50 lines,  I mean
in the size of the viewable screen.

Start a msdos prompt in windows 98. Rightclick the icon i the top/left corner and choose properties. On the leaf layout, find the item called window size and increase the Height value.

>>Also,  how can I solve the problem of DOS 8.3.

All windows versions except windows 3.1/3.11 understands and can use long filenames. If you want to specify a path on a commandline with spaces just enclose it in " signs. Like this:
start "c:\program files\some.jpg"

Hope this helps
Tonny
0
 

Author Comment

by:TLTEO
Comment Utility
I have written a batch file like

java -cp c:\program files\somethg\thisfile.jar Runthis %1%2%3

whenever a file with extension .cpl is clicked, it will run this batch file.  But if I click a file with file name like  12345678910.cpl

the batch file will truncate the rest, becoming 123456~1.cpl.   In the end the wrong file or file not found is given.  This dont seems to have problem with 2000. But only 98.  

How do I solve this?


0
 
LVL 10

Expert Comment

by:tonnybrandt
Comment Utility
I still belive that all you need to do is enclose the parameter, where the filename is passed to the batchfile in " signs.

Please give an example that shows where exactly, the filename is passed to the batchfile. (there is no spaces between %1 and %2 so it's unlikely that it is there)


0
 

Author Comment

by:TLTEO
Comment Utility
for example in a email attachment.  When I double click it, it calls for this batch file and runs

C:\>java -cp c:\progra~1\myprog~1\myProg.jar myApp  "C:\WINDOWS\LOCALS~1\TEMPOR~1\CONTENT.IE5\CXAZ43O7\XP15ISVU.CPL"

it works if the filename is shorter than 8 characters

but if the filename is longer than 8 characters like
XP15ISVU145.CPL ..  it becomes XP15IS~1.CPL

everytime it gives me a error of file not found.

How can I resolve this?



0
 
LVL 41

Expert Comment

by:stevenlewis
Comment Utility
when using the quotes, don't use the 8.3 naming convention example
"C:\WINDOWS\LOCALS~1\TEMPOR~1\CONTENT.IE5\CXAZ43O7\XP15ISVU.CPL"
=
"C:\WINDOWS\LOCALServer\TEMPORary internet files\CONTENT.IE5\CXAZ43O7\XP15ISVU.CPL"
0
 

Author Comment

by:TLTEO
Comment Utility
The fact is that when the batch file is called, the command line is

java -cp c:\program files\somethg\thisfile.jar Runthis %1%2%3


the file is name is chosen by %1%2%3.This automatically calls for 8.3 naming. How can I stopped the 8.3 naming convention
0
 

Author Comment

by:TLTEO
Comment Utility
Any solution yet?? Tks vm in advance
0
 
LVL 10

Expert Comment

by:tonnybrandt
Comment Utility
TLTEO: i can't check this untill i get to work, where i have access to a windows 98 machine. You have explained your problem very well, but one thing is missing in the picture:
You say: When i doubleclick it, it.....

How is that set up ?. in file associations ?
If it is, you must post the exact syntax for the doubleclick command here, so i have something to troubleshoot from. (Just copy it from fileassociations)
0
 

Author Comment

by:TLTEO
Comment Utility
I use an installation program to install the file type in the key registry.  So whenever it sees .cpl  it runs myApp.bat

I did not use the Folder options to change manually

The installation script is :

Root: HKCR; Subkey: ".cpl"; ValueType: string; ValueName: ""; ValueData: "myApp"; Flags: uninsdeletevalue

Root: HKCR; Subkey: "myApp\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\myApp.bat"" ""%1%2%3%4"""

0
 
LVL 10

Expert Comment

by:tonnybrandt
Comment Utility
I see you problem now. I have performed a test on both win 98 and win 2000, where i "echo'ed" the parameter passed to the batch file. The win 2000 passes Long filename enclosed in " , but the win 98 passes in 8+3 format. I have no solution for this at this time, but will keep looking, and post back if i find an answer.
0
 

Author Comment

by:TLTEO
Comment Utility
Tks .  eagerly awaiting your answer. I have tested a few thing s but to no avail.  Hope you can help me through this. Cheers
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 10

Expert Comment

by:tonnybrandt
Comment Utility
Haven't found any answers, but just thought of one thing.
How about running the java program directly from the shell\open command, meaning replace the ""{app}\myApp.bat"" ""%1%2%3%4""" with a call directly to the java command.

It seems that it is only when the parameter "hits" command.com that it get's truncated.

Just a thought, maybe you can use it.
Tonny

0
 

Author Comment

by:TLTEO
Comment Utility
I can't get it out. So frustrating.
0
 

Author Comment

by:TLTEO
Comment Utility
Now i have a new prob.  I am trying to use a pif shortcut to call the batch file.  It works fine in 98 and ME.

But in win 2000 professional,  It can even call the batch file properly at all.  

PIF files have a  button call exit on close.

0
 

Author Comment

by:TLTEO
Comment Utility
Any luck from anyone??

How come PIF  does not seems to wotk on windows 2000
0
 
LVL 10

Expert Comment

by:tonnybrandt
Comment Utility
Sorry, i haven't been around lately, but i have failed to find a solution for you. I can see what is happening, but i simply don't know how to work around it or fix it.

With regards to pif files, they are different for the win 9x/me and the NT/2000. Although they serve the same purpose, you cannot use a win 9x pif file on a 2000 or a 2000 pif file on a 98.
0
 

Author Comment

by:TLTEO
Comment Utility
Hmm

So is there any short cut that I can use instead of PIF files.

I have seen .lnk  files,  but they dont have functions that says closed on exit
0
 
LVL 10

Expert Comment

by:tonnybrandt
Comment Utility
How about just let the last line on the batchfile be
exit
0
 

Author Comment

by:TLTEO
Comment Utility
Effectively,  if I put

cls
exit

the ugly screen will only go off once I finish my program
system.exit(1)  in java.  

ie  (close on exit)


But if I use a short cut (PIF) to call this batch file, the batch file will automatically close itself oce the program is started.


Therefore, without a shortcut, I can get rid of the ugly MS DOS screen.  Just wonder why windows have to be build in this way!!!!!.  It is perfectly fine in 98 n ME

But not 2000...  so funny


Perhaps in 2000, only a shortcut to call a .exe works.  ie my thinking I think.



0
 
LVL 10

Expert Comment

by:tonnybrandt
Comment Utility
The shortcuts to msdos programs in win2000 is actually pif-files.
The pif files are autocreated in the same folder as where the exe file is located when you rightclick a dos program in windows 2000 and choose properties. Try it and make a search for *.pif and you will see.
0
 
LVL 10

Accepted Solution

by:
tonnybrandt earned 50 total points
Comment Utility
I accidently fell over this page. I think you might be able to find some usefull info in here:
http://www.ericphelps.com/batch/samples/filename.bat.txt
0
 

Author Comment

by:TLTEO
Comment Utility
tks tonnybrandt

you have been a great help. Finally it is solved.

would definitely post for your answer again if I have any. Cheers
0
 
LVL 41

Expert Comment

by:stevenlewis
Comment Utility
good call Tonny!!
TLTEO, glad you got it finally
0
 

Author Comment

by:TLTEO
Comment Utility
Tks.  You guys have been very very helpful.  Apprec it vm. Cheers.  I just wonder how much more incompatability  win2000 will cause in the  future to come
0
 
LVL 10

Expert Comment

by:tonnybrandt
Comment Utility
Glad you got it solved.

My best regards to all.
Tonny
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

The use of stolen credentials is a hot commodity this year allowing threat actors to move laterally within the network in order to avoid breach detection.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now