windows 98 batch file reader for NT is there an emulator or something
#1
Posted 22 June 2008 - 07:06 PM
#2
Posted 22 June 2008 - 07:20 PM
First, you could grab choice.exe from the win2k resource kit or such, or a similar 3rd party util (Win2003 and Vista do have choice.exe, and I believe Win 2008 does too).
Secondly, why learn the win98 specific stuff, instead of the newer/more recent ways? i.e. SET /P
#3
Posted 22 June 2008 - 09:32 PM
Besides the differences in syntax and in the commands themselves, you also have the problem of long file names, which are common on NT systems but have to be truncated for batch files in DOS. The truncated names used by DOS will cause problems in batch files run on NT systems. All the paths are likely to be completely different as well. On NT systems, the batch files run in windows, which limits what can be done with them compared to those running in pure DOS.
I haven't seen an emulator that does what you're asking. Even if one does exist and can handle the differences in the commands, file name length, and the syntax, it wouldn't be able to account for the differences in the paths used in the batch file. You'd still have to edit those manually. It would be easier in the long run just to write separate batch files for each.
Rick
#4
Posted 24 June 2008 - 04:04 PM
#5
Posted 24 June 2008 - 06:02 PM
TheRedFox, on Jun 25 2008, 01:04 AM, said:
I'm actually glad they're different. I'm doing a XP patch for an older game and i use command line scripts a lot. On 98/Me the batch simply does not run, sparing me of the trouble to implement a version checker.
You can run a virtual 98 machine inside your XP and learn on that.
#6
Posted 24 June 2008 - 06:11 PM
Some more DOS sites:
http://www.ahuka.com/dos/index.html
http://dos.rsvs.net/
http://home7.inet.te...es/batfiles.htm
Rick
This post has been edited by herbalist: 24 June 2008 - 06:26 PM
#7
Posted 26 October 2012 - 07:03 AM
sorry for bringing up this old thread but I thought that is not necessary to create a new one just for my small problem which may be solved in a few seconds by people with the knowledge !!
I have two batch files which I need to run every two months or so but they work only on XP and I just would like to know why they are not working on an 98SE machine ?
1)
@echo off
for /k %%b in (3000000,1,3030799) do if exist %%b.jpg copy 0001o.jpg %%b.jpg
2)
@echo off
for /k %%b in (3030800,1,3030999) do copy 0001o.jpg %%b.jpg
Any ideas ? Best regards, Mikl
#8
Posted 26 October 2012 - 09:07 AM
#9
Posted 29 October 2012 - 05:19 AM
It is not live saving issue but I would love to do that work without having to go to XP ...
#10
Posted 29 October 2012 - 07:09 AM
MiKl, on 29 October 2012 - 05:19 AM, said:
It is not live saving issue but I would love to do that work without having to go to XP ...
The issue right now is that the FOR /K is NOT a documented batch command in XP either.
The syntax seems like it is a FOR /L loop:
http://www.robvander...e.com/ntfor.php
What those one-liners (a batch script tends to be a little more complex) - provided that a /L switch is used - seem aimed to perform is an apparently senseless task, i.e. going through a number of files named n.jpg (respectively with n from 3000000 to 3030799 and from 3030800 to 3030999) and replace all find occurences of the file with a copy of the same source image 0001o.jpg (and of course just one of the two spanning from 3000000 to 3030999 would do instead).
Maybe if you explain the actual goal it would be easier to provide you with some suggestions.
jaclaz
#11
Posted 30 October 2012 - 08:03 AM
I just overlooked to correct the /K /L-thing back to the original XP-script because I was testing various (parameter-) versions in the hope that one would work on 98SE.
Do you maybe know how a loop have to look like for 98SE ?
MiKl
#12
Posted 30 October 2012 - 08:19 AM
#13
Posted 30 October 2012 - 08:58 AM
If anybody else could just give me a rough guide how a loop would like I could start from there. Thank you.
#14
Posted 30 October 2012 - 09:50 AM
MiKl, on 30 October 2012 - 08:58 AM, said:
But you didn't state the actual result you want (and BTW the one liners you posted with the /K swtch have NO way to be actually working, and once the /K is replaced with /L they become sintactically coorect but still make little sense), I had to guess and I am not even 100% sure to have guessed right.
MiKl, on 30 October 2012 - 08:58 AM, said:
Good
You are consequently kindly invited to ignore this:
http://groups.google...864a7a9b2?pli=1
and this:
http://www.msfn.org/...-to-commandcom/

jaclaz
#15
Posted 31 October 2012 - 03:06 AM
MiKl, on 26 October 2012 - 07:03 AM, said:
1)
@echo off
for /k %%b in (3000000,1,3030799) do if exist %%b.jpg copy 0001o.jpg %%b.jpg
Try this (the "if exist" is incorporated into the file set):
@echo off for %%b in (300????.jpg) do copy 0001o.jpg %%b for %%b in (301????.jpg) do copy 0001o.jpg %%b for %%b in (302????.jpg) do copy 0001o.jpg %%b for %%b in (30300??.jpg) do copy 0001o.jpg %%b for %%b in (30301??.jpg) do copy 0001o.jpg %%b for %%b in (30302??.jpg) do copy 0001o.jpg %%b for %%b in (30303??.jpg) do copy 0001o.jpg %%b for %%b in (30304??.jpg) do copy 0001o.jpg %%b for %%b in (30305??.jpg) do copy 0001o.jpg %%b for %%b in (30306??.jpg) do copy 0001o.jpg %%b for %%b in (30307??.jpg) do copy 0001o.jpg %%b
MiKl, on 26 October 2012 - 07:03 AM, said:
@echo off
for /k %%b in (3030800,1,3030999) do copy 0001o.jpg %%b.jpg
If we note that the copy is unconditional, and presume that because of previous action, the files already exist, then we can reuse the previous plan of attack:
@echo off for %%b in (30308??.jpg) do copy 0001o.jpg %%b for %%b in (30309??.jpg) do copy 0001o.jpg %%b
Combining the two:
@echo off for %%b in (300????.jpg) do copy 0001o.jpg %%b for %%b in (301????.jpg) do copy 0001o.jpg %%b for %%b in (302????.jpg) do copy 0001o.jpg %%b for %%b in (3030???.jpg) do copy 0001o.jpg %%b
If we cannot presume that any files have previously been created, this second batch file can be done recursively:
@echo off if %1*==* for %%a in (8,9) do call %0 3030%%a if not %1*==* if %2*==* for %%b in (0,1,2,3,4,5,6,7,8,9) do call %0 %1 %1%%b if not %2*==* for %%c in (0,1,2,3,4,5,6,7,8,9) do copy 0001o.jpg %2%%c.jpg



Help
Back to top









