Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problems batch file not working 1

Status
Not open for further replies.

mickymoo

Programmer
Apr 4, 2002
23
GB
When I run this batch file on w2000 it works perfectly.

When I run it on w98 I get the error Bad name or command and it hangs. Any ideas why?



rem this batch file copies all the necessary dll's and ocx files to make crystal viewer work properly on a computer


if exist %systemroot%\system32 copy u:\needed\*.dll %SystemRoot%\system32
if exist %systemroot%\system32 copy u:\needed\*.ocx %SystemRoot%\system32


regsvr32 %systemroot%\system32\craxdrt.dll /s
regsvr32 %systemroot%\system32\crviewer.dll /s
regsvr32 %systemroot%\system32\ExportModeller.dll /s
regsvr32 %systemroot%\system32\crtslv.dll /s
regsvr32 %systemroot%\system32\comdlg32.ocx /s



thanks

Michael
 
Hi Michael,

You could try this and see if it works in Win 98.

1. Open a command prompt
2. Type the following echo %systemroot%

I am taking a guess that may be Win 98 does not support the system root parameter.

Cheers,

Tony.
 
I tested this myself. Had to find a 98 machine first!

98 does not supported the system root parameter, so I think the answer is either to hard code the location or alternatively looking for the user to input the location (assuming this is feasible)

Tony.
 
98 also uses system not system32 (generally)
 
But in principal bearing in mind I get the batch file correct, there is no reason why this approach shouldn't work?




 
You might need to check regserv32 as well. Otherwise I think it should be okay.
 
Check it in what way? (pardon my ignorance I have little experience in this way)
 
Do a search and see if you can find a file claeed regserv32.*, if not do a search for reg*.* and see if the file exists.
 
read what wolluf posted and modify those lines [sub]If 'something' 'somewhere' gives 'some' error, excpect random guesses or no replies at all. Please specify details.
Free Tip: The F1 Key does NOT destroy your PC! -
Marc[/sub]
 
thank you one and all
unfortunately I cannot test this until monday but thanks anyway
 
FYI:
The %systemroot% parameter is the Windows Directory. The reason they did it this way is to cover all OS's. In WIN98 it's C:\WINDOWS, in NT it's C:\WINNT, in 2000 it's WINNT, and in XP it could be either!
So, if you are running this in WIN98 change the lines to
if exist c:\windows\system32 copy u:\needed\*.dll c:\windows\system32

JON
 
Jontmke, there is NO system32 in 98 !
That was wolluf's remark and I already pointed to that!
%systemroot% should work just fine, but NOT with system32 ! [sub]If 'something' 'somewhere' gives 'some' error, excpect random guesses or no replies at all. Please specify details.
Free Tip: The F1 Key does NOT destroy your PC! -
Marc[/sub]
 
Well, maybe some crappy install created one, but I do have a system32 directory on my WIN98 pc. It is not the "system" directory where the critical windows files are located, true, but maybe this program will be looking for them there when it runs and will fail if it is not there.

Come to think of it, maybe this program is not MADE to run on WIN9X at all.

Look on the install CD and see if there is another install directory for WIN9X.

JON
 
Jontmke, some apps can indeed create the system32 folder, but regsrv32 is in system.

Also, the issue here is not whether the app works in 98 or not, it is the batch file giving an error saying: bad name or command.
That only happens when a file or command is not found, wich is the case here because of a wrong path. [sub]If 'something' 'somewhere' gives 'some' error, excpect random guesses or no replies at all. Please specify details.
Free Tip: The F1 Key does NOT destroy your PC! -
Marc[/sub]
 
thanks all of you for your help I got it working

First of all it needed to be system not system 32

secondly I had to physically set the path for regsvr32 in the batch file

ie cd c:\windows\system

It now works fine (ish)

it doesn't seem to want to register my comdlg32.dll file but I suspect that this is beacuse it only works with systems after W98

anyway thanks all
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top