Windows XP Community - XPHeads



Execute batch file regardless the operating system

microsoft.public.windowsxp.general


Reply
  #1 (permalink)  
Old 05-26-2008, 10:18 PM
happytoday
 
Posts: n/a
Execute batch file regardless the operating system
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 05-26-2008, 11:49 PM
Sjouke Burry
 
Posts: n/a
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 05-27-2008, 01:48 AM
Ted Davis
 
Posts: n/a
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).


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 05-27-2008, 05:21 AM
Pegasus \(MVP\)
 
Posts: n/a
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}


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 05-27-2008, 10:39 AM
foxidrive
 
Posts: n/a
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 **
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 05-29-2008, 11:12 PM
Pegasus \(MVP\)
 
Posts: n/a
Re: Execute batch file regardless the operating system

"foxidrive" <gotcha@woohoo.invalid> wrote in message
news5pn34h7g60t95uotkpqek257sbul6agm9@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.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 05-30-2008, 01:29 AM
Ted Davis
 
Posts: n/a
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).


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 05-30-2008, 05:02 AM
foxidrive
 
Posts: n/a
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.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 05-30-2008, 12:51 PM
Ted Davis
 
Posts: n/a
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)


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 05-30-2008, 04:24 PM
Ken Blake, MVP
 
Posts: n/a
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...p_home_pro.asp

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

http://www.microsoft.com/windowsxp/h.../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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 09:25 AM.


Registry Mechanic - Free Scan Now
Driver Scanner 2009 - Free Scan Now




Design by Vjacheslav Trushkin for phpBBStyles.com.
Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74