Jump to content

Execute batch file regardless the operating system


Recommended Posts

Guest happytoday
Posted

Hello,

I have t different versions of windows XP. One of them on HP machine

and the other on IBM. So I am executing the same batch files on the

same machines but some commands are varied from machine to machine .

Do I have a system variable that contain information about the machine

system and can ce recognized with my batch file ?

I need to execute from inside my batch file for example :

 

 

#if def SYS_Variable = IBM

execute date format routine

#else if SYS_Variable = HP

execute another date format routine

 

 

Thanks

Guest Sjouke Burry
Posted

Re: Execute batch file regardless the operating system

 

happytoday wrote:

> Hello,

> I have t different versions of windows XP. One of them on HP machine

> and the other on IBM. So I am executing the same batch files on the

> same machines but some commands are varied from machine to machine .

> Do I have a system variable that contain information about the machine

> system and can ce recognized with my batch file ?

> I need to execute from inside my batch file for example :

>

>

> #if def SYS_Variable = IBM

> execute date format routine

> #else if SYS_Variable = HP

> execute another date format routine

>

>

> Thanks

Checking in a cmd window mine showes:

 

 

CLASSPATH=.;C:\Program Files\Java\jre1.5.0_10\lib\ext\QTJava.zip

CommonProgramFiles=C:\Program Files\Common Files

COMPUTERNAME=INTERNETBUGGY

ComSpec=C:\WINDOWS\system32\cmd.exe

FP_NO_HOST_CHECK=NO

 

 

So you can use %COMPUTERNAME% to find out on which machine

your batch is running.

Like for mine:

 

if %COMPUTERNAME%==INTERNETBUGGY echo what a strange computer name

 

Backchecking,copy/paste the line in cmd window... Yep, it works.

Guest Ted Davis
Posted

Re: Execute batch file regardless the operating system

 

On Mon, 26 May 2008 15:18:54 -0700, happytoday wrote:

> Hello,

> I have t different versions of windows XP. One of them on HP machine and

> the other on IBM. So I am executing the same batch files on the same

> machines but some commands are varied from machine to machine . Do I have

> a system variable that contain information about the machine system and

> can ce recognized with my batch file ? I need to execute from inside my

> batch file for example :

 

I find it hard to believe that commands vary from machine to machine -

applications, utilities, and tools, yes, but not the commands (the batch

language, mostly). Exactly *what* commands vary and how do they vary. As

far as I know, there is no real difference in the native commands within

XP subversions, especially if all the updates and service packs have been

applied as they should.

 

--

 

T.E.D. (tdavis@mst.edu) MST (Missouri University of Science and Technology)

used to be UMR (University of Missouri - Rolla).

Guest Pegasus \(MVP\)
Posted

Re: Execute batch file regardless the operating system

 

 

"happytoday" <ehabaziz2001@gmail.com> wrote in message

news:d91d8db6-c5be-4737-a73c-3a02366f9b3b@34g2000hsh.googlegroups.com...

> Hello,

> I have t different versions of windows XP. One of them on HP machine

> and the other on IBM. So I am executing the same batch files on the

> same machines but some commands are varied from machine to machine .

> Do I have a system variable that contain information about the machine

> system and can ce recognized with my batch file ?

> I need to execute from inside my batch file for example :

>

>

> #if def SYS_Variable = IBM

> execute date format routine

> #else if SYS_Variable = HP

> execute another date format routine

>

>

> Thanks

 

A general answer: To see all your environmental variables, click

Start / Run / cmd {OK}, then type this command:

 

set {Enter}

Guest foxidrive
Posted

Re: Execute batch file regardless the operating system

 

On Mon, 26 May 2008 20:48:26 -0500, Ted Davis <tdavis@umr.edu> wrote:

>On Mon, 26 May 2008 15:18:54 -0700, happytoday wrote:

>

>> I have t different versions of windows XP.

>

>I find it hard to believe that commands vary from machine to machine -

>applications, utilities, and tools, yes, but not the commands (the batch

>language, mostly). Exactly *what* commands vary and how do they vary. As

>far as I know, there is no real difference in the native commands within

>XP subversions, especially if all the updates and service packs have been

>applied as they should.

 

Home and Pro have different command sets.

 

** Posted from http://www.teranews.com **

Guest Pegasus \(MVP\)
Posted

Re: Execute batch file regardless the operating system

 

 

"foxidrive" <gotcha@woohoo.invalid> wrote in message

news:o5pn34h7g60t95uotkpqek257sbul6agm9@4ax.com...

> On Mon, 26 May 2008 20:48:26 -0500, Ted Davis <tdavis@umr.edu> wrote:

>

>>On Mon, 26 May 2008 15:18:54 -0700, happytoday wrote:

>>

>>> I have t different versions of windows XP.

>>

>>I find it hard to believe that commands vary from machine to machine -

>>applications, utilities, and tools, yes, but not the commands (the batch

>>language, mostly). Exactly *what* commands vary and how do they vary. As

>>far as I know, there is no real difference in the native commands within

>>XP subversions, especially if all the updates and service packs have been

>>applied as they should.

>

> Home and Pro have different command sets.

>

> ** Posted from http://www.teranews.com **

 

The command sets of the two OSs are by and large the same

even though WinXP Home may lack some of the advanced

commands that are included in WinXP Home.

Guest Ted Davis
Posted

Re: Execute batch file regardless the operating system

 

On Tue, 27 May 2008 20:39:38 +1000, foxidrive wrote:

> Home and Pro have different command sets.

 

I've never used Home - I was told it's juat a crippled version without all

the networking. I had assumed that the basic command sets, except for

network commands which obviously don't apply in the OP's case. What else

is missing?

 

--

 

T.E.D. (tdavis@mst.edu) MST (Missouri University of Science and Technology)

used to be UMR (University of Missouri - Rolla).

Guest foxidrive
Posted

Re: Execute batch file regardless the operating system

 

On Thu, 29 May 2008 20:29:46 -0500, Ted Davis <tdavis@umr.edu> wrote:

>> Home and Pro have different command sets.

>

>I've never used Home - I was told it's juat a crippled version without all

>the networking. I had assumed that the basic command sets, except for

>network commands which obviously don't apply in the OP's case. What else

>is missing?

 

Tasklist and taskkill I believe, and more.

 

It's documented at MS if you can still find it.

Guest Ted Davis
Posted

Re: Execute batch file regardless the operating system

 

On Fri, 30 May 2008 15:02:10 +1000, foxidrive wrote:

> Tasklist and taskkill I believe, and more.

 

Both of which are network administration utilities, though they do have

local uses. I would count them in the networking group.

 

A simple way to solve the original problem would be to look for one of the

utilities that doesn't exist on one of the machines. There might also be

some network related environment variables that are present in one but not

the other - the OP would have to dump the environments and compare them.

 

--

T.E.D. (tdavis@mst.edu)

Guest Ken Blake, MVP
Posted

Re: Execute batch file regardless the operating system

 

On Thu, 29 May 2008 20:29:46 -0500, Ted Davis <tdavis@umr.edu> wrote:

> On Tue, 27 May 2008 20:39:38 +1000, foxidrive wrote:

>

> > Home and Pro have different command sets.

>

> I've never used Home - I was told it's juat a crippled version without all

> the networking.

 

 

 

I wouldn't used the word "crippled," but XP Professional and XP Home

are exactly the same in all respects, except that Professional has a

few features (mostly related to networking and security) missing from

Home. For most (but not all) home users, even those with a home

network, these features aren't needed, would never be used, and buying

Professional instead of Home is a waste of money.

 

For details go to

http://www.winsupersite.com/showcase/windowsxp_home_pro.asp

 

http://www.microsoft.com/windowsxp/whichxp.asp

 

http://www.microsoft.com/windowsxp/home/howtobuy/choosing2.asp

 

Also note one other point not mentioned on any of those sites:

Professional allows ten concurrent network connections, and Home only

five.

 

> I had assumed that the basic command sets, except for

> network commands which obviously don't apply in the OP's case. What else

> is missing?

 

 

Essentially nothing. The command sets are pretty much identical,

except that Home is missing a small number of commands that don't

pertain to its feature set.

 

--

Ken Blake, Microsoft MVP - Windows Desktop Experience

Please Reply to the Newsgroup

Guest monoco
Posted

Re: Execute batch file regardless the operating system

 

On May 30, 1:24 pm, "Ken Blake, MVP"

<kbl...@this.is.an.invalid.domain> wrote:

> On Thu, 29 May 2008 20:29:46 -0500, Ted Davis <tda...@umr.edu> wrote:

> > On Tue, 27 May 2008 20:39:38 +1000, foxidrive wrote:

>

> > > Home and Pro have different command sets.

>

> > I've never used Home - I was told it's juat a crippled version without all

> > the networking.

>

> I wouldn't used the word "crippled," but XP Professional and XP Home

> are exactly the same in all respects, except that Professional has a

> few features (mostly related to networking and security) missing from

> Home. For most (but not all) home users, even those with a home

> network, these features aren't needed, would never be used, and buying

> Professional instead of Home is a waste of money.

>

> For details go tohttp://www.winsupersite.com/showcase/windowsxp_home_pro.asp

>

> http://www.microsoft.com/windowsxp/whichxp.asp

>

> http://www.microsoft.com/windowsxp/home/howtobuy/choosing2.asp

>

> Also note one other point not mentioned on any of those sites:

> Professional allows ten concurrent network connections, and Home only

> five.

>

> > I had assumed that the basic command sets, except for

> > network commands which obviously don't apply in the OP's case.  What else

> > is missing?

>

> Essentially nothing. The command sets are pretty much identical,

> except that Home is missing a small number of commands that don't

> pertain to its feature set.

>

> --

> Ken Blake, Microsoft MVP - Windows Desktop Experience

> Please Reply to the Newsgroup

 

My two cents.

 

Another BIG difference between Home and Professional Windows XPs is

that

Windows XP Professional has Terminal Service, which Home doesn't.

 

Meaning this would NOT let you do a RDP session to a Home version of

Windows XP. Instead you'd need to find another way of desktop sharing

such as VNC or DAMEWARE or whatever. So measing that feature I'd

really be pissed off!!!

 

Regards

Guest John John (MVP)
Posted

Re: Execute batch file regardless the operating system

 

monoco wrote:

> On May 30, 1:24 pm, "Ken Blake, MVP"

> <kbl...@this.is.an.invalid.domain> wrote:

>

>>On Thu, 29 May 2008 20:29:46 -0500, Ted Davis <tda...@umr.edu> wrote:

>>

>>>On Tue, 27 May 2008 20:39:38 +1000, foxidrive wrote:

>>

>>>>Home and Pro have different command sets.

>>

>>>I've never used Home - I was told it's juat a crippled version without all

>>>the networking.

>>

>>I wouldn't used the word "crippled," but XP Professional and XP Home

>>are exactly the same in all respects, except that Professional has a

>>few features (mostly related to networking and security) missing from

>>Home. For most (but not all) home users, even those with a home

>>network, these features aren't needed, would never be used, and buying

>>Professional instead of Home is a waste of money.

>>

>>For details go tohttp://www.winsupersite.com/showcase/windowsxp_home_pro.asp

>>

>>http://www.microsoft.com/windowsxp/whichxp.asp

>>

>>http://www.microsoft.com/windowsxp/home/howtobuy/choosing2.asp

>>

>>Also note one other point not mentioned on any of those sites:

>>Professional allows ten concurrent network connections, and Home only

>>five.

>>

>>

>>>I had assumed that the basic command sets, except for

>>>network commands which obviously don't apply in the OP's case. What else

>>>is missing?

>>

>>Essentially nothing. The command sets are pretty much identical,

>>except that Home is missing a small number of commands that don't

>>pertain to its feature set.

>>

>>--

>>Ken Blake, Microsoft MVP - Windows Desktop Experience

>>Please Reply to the Newsgroup

>

>

> My two cents.

>

> Another BIG difference between Home and Professional Windows XPs is

> that

> Windows XP Professional has Terminal Service, which Home doesn't.

 

That is not true. Without Terminal Services there would be no Fast User

Switching and XP Home has FUS. Also, without Terminal Services XP Home

would be incapable of accepting Remote Assistance and it would be

incapable of acting as the client in a Remote Desktop session. XP Home

cannot act as the Server in an RDP session, but that is not because it

lacks Terminal Services.

 

John

Guest Clay Calvert
Posted

Re: Execute batch file regardless the operating system

 

On Thu, 29 May 2008 20:29:46 -0500, Ted Davis <tdavis@umr.edu> wrote:

>On Tue, 27 May 2008 20:39:38 +1000, foxidrive wrote:

>

>> Home and Pro have different command sets.

>

>I've never used Home - I was told it's juat a crippled version without all

>the networking. I had assumed that the basic command sets, except for

>network commands which obviously don't apply in the OP's case. What else

>is missing?

 

Based on this list (http://www.tacktech.com/display.cfm?ttid=104) down

below are the .exe files that don't exist in XP Home.

 

In my opinion, the best desktop OS ever made by MS is XP Media Center

Edition 2005. It is based on Pro, has more features and it is

cheaper. MS hobbled it so that it can't 'easily' join a domain

(include caching credentials) but they are the only limitations.

 

asr_fmt

asr_ldm

bootcfg

cipher

convlog

davcdata

drvqry

evcreate

evtrig

getmac

gprslt

gpupdate

iisreset

iisrstas

iissync

inetin51

inetmgr

logman

mqbkup

mqsvc

mqtgsvc

ntbackup

nw16

nwscript

opnfiles

proxycfg

relog

rsnotify

rsopprov

sctasks

secedit

sysinfo

taskkill

tasklist

tlntadmn

tlntsess

tlntsvr

tourw

tracerpt

typeperf

vwipxspx

wmic

Guest Clay Calvert
Posted

Re: Execute batch file regardless the operating system

 

On Fri, 30 May 2008 07:51:25 -0500, Ted Davis <tdavis@umr.edu> wrote:

>On Fri, 30 May 2008 15:02:10 +1000, foxidrive wrote:

>

>> Tasklist and taskkill I believe, and more.

>

>Both of which are network administration utilities, though they do have

>local uses. I would count them in the networking group.

 

I use Tasklist often and have used TaskKill in scenarios where Task

Manager wasn't practical. It is because of these two tools, and WMIC,

that I upgraded from XP Home. XP Pro is on my laptop and XP Media

Center Edition 2005 is on my desktop.

Guest Ted Davis
Posted

Re: Execute batch file regardless the operating system

 

On Sat, 31 May 2008 20:44:20 -0400, Clay Calvert wrote:

> On Fri, 30 May 2008 07:51:25 -0500, Ted Davis <tdavis@umr.edu> wrote:

>

>>On Fri, 30 May 2008 15:02:10 +1000, foxidrive wrote:

>>

>>> Tasklist and taskkill I believe, and more.

>>

>>Both of which are network administration utilities, though they do have

>>local uses. I would count them in the networking group.

>

> I use Tasklist often and have used TaskKill in scenarios where Task

> Manager wasn't practical. It is because of these two tools, and WMIC,

> that I upgraded from XP Home. XP Pro is on my laptop and XP Media Center

> Edition 2005 is on my desktop.

 

People who use PsTools are unlikely to notice their absence.

 

--

 

T.E.D. (tdavis@mst.edu) MST (Missouri University of Science and Technology)

used to be UMR (University of Missouri - Rolla).

×
×
  • Create New...