Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

site to find Win9x and 2000/XP differences in batch command

0 views
Skip to first unread message

S?bastien WILLEMIJNS

unread,
Dec 18, 2003, 4:57:36 AM12/18/03
to
hello,

i'm looking for a site who know all the differences between 98 and XP
batchs language because i want to update my 98 batchs to XP ;)

Al Dunbar

unread,
Dec 19, 2003, 9:42:03 PM12/19/03
to

"S?bastien WILLEMIJNS" <seba...@willemijns.com> wrote in message
news:7ce56313.03121...@posting.google.com...

> hello,
>
> i'm looking for a site who know all the differences between 98 and XP
> batchs language because i want to update my 98 batchs to XP ;)

Good luck. But you may be making too much work for yourself. It is quite
likely that your batch files do not use all of the Win98 features that would
cause you problems when converting them to XP.

Also, some of the differences are merely additional features in XP that,
since they do not exist in 98, your batches will not be using them. For
example, XP batch has boolean operators like:

if /i "%var%" EQU "john" ...

You may be using the "==" operator, which works just as well in XP.
Similarly, in XP, you can do arithmetic with variables:

set /a var1 = 12
set /a var2 = 23
set /a var = var1 * var2

Nice to know, but since your 98 batches are not likely doing any arithmetic,
there is no need to change them because of this difference.

I'm not suggesting that you will face no challenges in the migration, as
there are a number of things that your batches might be doing that would
work differently in XP. Some of these may be common side effects of commands
that you have come to rely on. While instructive, a site listing all of the
goofy things that have been done to make pre-NT batch more useful would
contain a lot of information otherwise useless to you. Unfortunately, you
are very unlikely to find a site or resource that just the features that you
have implicitly made use of.

Others will, I am sure, give you lots of reference info, and that is great.
I would recommend that you break your project into the following phases:

- are some of your batches generating functionality missing in 98 that is
present in XP without writing a batch file?

- are some of your batches doing things that, because of other differences
between the operating systems, are no longer necessary?

- of the important batch files, which ones run correctly on XP without
modification?

- those that fail to run, do you really need them? do they produce error
messages? What else do they do? Some will likely be fairly easy to track
down by setting echo on instead of off, for example.

Once you have converted your batches to run, and are operational in XP, you
might think about some of the added functionality now available to you,
whether to enhance the operation of the existing scripts or to help you
create new ones. But don't get too involved with adding functionality when
job number one is to get things working in the new environment.


/Al


S?bastien WILLEMIJNS

unread,
Dec 20, 2003, 8:57:45 AM12/20/03
to
"Al Dunbar" <Alan-no-...@hotmail.com> wrote in message news:<%FOEb.754538$6C4.503569@pd7tw1no>...

> > hello,
> >
> > i'm looking for a site who know all the differences between 98 and XP
> > batchs language because i want to update my 98 batchs to XP ;)

> Good luck. But you may be making too much work for yourself. It is quite
> likely that your batch files do not use all of the Win98 features that would
> cause you problems when converting them to XP.

i've only noticed that i must use commas in my "if %1==foo goto foo"
but
is it sufficient ?


> example, XP batch has boolean operators like:
>
> if /i "%var%" EQU "john" ...
>

> Nice to know, but since your 98 batches are not likely doing any arithmetic,
> there is no need to change them because of this difference.

no, see my first answer ;) it is very easy to find a site who explain
news improvements from XP/2K batchs...

> - are some of your batches doing things that, because of other differences
> between the operating systems, are no longer necessary?

my batchs


> - of the important batch files, which ones run correctly on XP without
> modification?

0/2 :)



> - those that fail to run, do you really need them? do they produce error
> messages? What else do they do? Some will likely be fairly easy to track
> down by setting echo on instead of off, for example.

yes, of course... i will be do it, it is only the alone method i can
now
use ;)

i think all my problems was only "syntax" error due to "small
languages" changes............. but i'm surprising nobody has not the
same trouble as me
when it has upgraded from 9x to 2K or XP ;)))))

Al Dunbar [MS-MVP]

unread,
Dec 20, 2003, 6:08:55 PM12/20/03
to

"S?bastien WILLEMIJNS" <seba...@willemijns.com> wrote in message
news:7ce56313.03122...@posting.google.com...

> "Al Dunbar" <Alan-no-...@hotmail.com> wrote in message
news:<%FOEb.754538$6C4.503569@pd7tw1no>...
>
> > > hello,
> > >
> > > i'm looking for a site who know all the differences between 98 and XP
> > > batchs language because i want to update my 98 batchs to XP ;)

<snip>

> > - those that fail to run, do you really need them? do they produce error
> > messages? What else do they do? Some will likely be fairly easy to track
> > down by setting echo on instead of off, for example.
>
> yes, of course... i will be do it, it is only the alone method i can
> now
> use ;)
>
> i think all my problems was only "syntax" error due to "small
> languages" changes............. but i'm surprising nobody has not the
> same trouble as me
> when it has upgraded from 9x to 2K or XP ;)))))

Oh, believe me, we all ran into problems. It is just the nature of batch
programming (i.e. we all do it differently) that the specific problems I
might have had would never happen to you, and vice versa.

/Al


Benny Pedersen

unread,
Dec 21, 2003, 8:21:53 PM12/21/03
to
"Todd Vargo" <todd...@nccw.net> wrote
news:bru19c$794q7$2...@ID-25025.news.uni-berlin.de...
>
> "Benny Pedersen" <b.pedersen(NO.SPAM)@get2net.dk> wrote in message
> news:3fe26e5d$0$27310$ba62...@nntp04.dk.telia.net...
> >
> > "S?bastien WILLEMIJNS" <seba...@willemijns.com> wrote
> > news:7ce56313.03121...@posting.google.com...

> > > hello,
> > >
> > > i'm looking for a site who know all the differences between 98 and XP
> > > batchs language because i want to update my 98 batchs to XP ;)
> >
> > Any NetCafe is now boycotting CS because of Steam and
> > since Nvidia swindling by optimizing their drivers for benchmark,
> > all people is now purchasing ATI. Hmmm, "Norton Internet Security"
> > is crashing Win98... so we will soon use other software... BUT
> > anyway, you won't use Linux instead of Microsoft ?
> >
> > OK. Here's a compromise:
> >
> > Create a file named "Choice.VBS".
> >
> > Then, when a batch file in WinXP see this:
> > Choice /c:123abcABC Hello
> > then it find "Choice.VBS" instead of "Choice.COM"
> > so you don't need to rewrite your old batch file:
> >
> > @echo off
> > choice /c:123abcABC Hello
> > FOR %%! IN (0 1 2 3 4 5 6 7 8 9) DO IF ERRORLEVEL %%!0 SET E=%%!
> > FOR %%! IN (0 1 2 3 4 5 6 7 8 9) DO IF ERRORLEVEL 1%%!0 SET E=1%%!
> > FOR %%! IN (0 1 2 3 4) DO IF ERRORLEVEL 2%%!0 SET E=2%%!
> > FOR %%! IN (0 1 2 3 4 5 6 7 8 9) DO IF ERRORLEVEL %E%%%! SET E=%E%%%!
> > FOR %%! IN (0 1 2 3 4 5) DO IF ERRORLEVEL 25%%! SET E=25%%!
> > echo. The Errorlevel is %E%
> > pause
> >
> > :: Benny Pedersen, http://2dos.homepage.dk
> > :: BTW: ignored the Choice /S switch.
> > :: PS: is also working without colon in the /C: switch.
> > :: TIPS: do ... loop while 0=errLe :-).
> >
> > 'Choice.VBS:
> > dim allow, input, errLe
> > allow = WScript.arguments(0)
> > allow = mid(allow, inStr(uCase(allow), "/C:") +3)
> > input = inputBox(WScript.arguments(WScript.arguments.count -1) &_
> > vbLf & vbLf & "Input one of the following characters:" &_
> > vbLf & allow, """Choice"". Press Enter when done.", "*")
> > errLe = inStr(allow,input) + cInt(input=empty)
> > wScript.quit(errLe)
>
> Sounds like a good trick Benny! Have you tested it with any kludge syntax
> used for parsing? Depending on what the old batch was doing, this trick may
> require that the default host be set to CSCRIPT to assure the correct host
> is used.

Hi

I ignored the /S switch, so the previous Choice.VBS could often fails.

@echo off
CHOICE /C123ABC Hello
REM would use Choice.VBS in WinXP (could temporary be
REM simulated in Win98) like:
REM cScript.exe//noLogo CHOICE.VBS /C123ABC Hello

Benny Pedersen,
PS. Details about the below Choice.VBS:
1: Escape would returns errorlevel 0.
2: The inputBox can't count down, so ex.
/T:a,1 won't work (only the "a" would be used).
BTW. Choice.VBS could still be useful as replacement for
Choice.COM in WinXP. Anyhow, the below is better
than the previous version.

' Choice.VBS
dim i,args,a,cArg,sArg,nArg,take,msg,errL
for i = 0 to (WScript.arguments.count -1)
args = args & replace(WScript.arguments(i),"/",";/") & ";"
next
args = split(args,";")
for i = 0 to uBound(args)
a = args(i)
if not a = empty then
select case uCase(left(a, 2))
case "/C" cArg = mid(a, 4 + (mid(a,3,1)<>":"))
case "/S" sArg = true
case "/N" nArg = true
case "/T" take = mid(a,-1 + inStr(a,","),1)
' tSec = mid(a, 1 + inStr(a,","))
case else msg = a
end select
end if
next
do: if nArg then
take = inputBox(string(5,vbLf) & msg, "Choice:", take)
else
take = inputBox(vbLf & "Input one of the following " &_
len(cArg) & " character(s): " & vbLf & vbLf & cArg,msg,take)
end if
if sArg then
errL = inStr(cArg, take) + cInt(take=empty)
else errL = inStr(uCase(cArg), uCase(take)) + cInt(take=empty)
end if
loop while(take=empty xor take=vbEmpty)or (errL=0 and take<>empty)
wScript.quit(errL)

0 new messages