batch file help - Techist - Tech Forum

Go Back   Techist - Tech Forum > Computer Software > Microsoft Windows and Software
Click Here to Login
Closed Thread
 
Thread Tools Display Modes
 
Old 08-06-2006, 11:24 AM   #1 (permalink)
Monster Techie
 
Join Date: Dec 2003
Posts: 1,084
Send a message via Yahoo to IBMan
Default batch file help

So I have a batch file that runs at t-12 during GUI mode in windows XP setup, the batch file runs silent installations of various programs on a server share, There are programs that I only want installed on certain workstations and not others, is there an if/then command I can put in there that does this...


Code:
If this computer's name is "mmdc" then install \\server\share\install.exe /silent, if computer's name is not mmdc then do not install this.
thanks in advance.
__________________

__________________
Server:
AMD Athlon 4000+ @ 2.4 GHz
4096 MB RAM
40 GB HDD
Dual Mirrored 500 GB HDDs
DVD-ROM Drive
Windows Server 2003 x64 R2 SP2
IBMan is offline  
Old 08-06-2006, 04:51 PM   #2 (permalink)
Monster Techie
 
Join Date: Apr 2005
Posts: 1,909
Send a message via AIM to jcortes
Default

there is an else statement which says if this statement is not true then do this instead

example
IF this computer is mmdc install ELSE do not install this

if you need the exact layout of how its done in a batch file i can give it to you just let me know.
__________________

__________________

AIM = jcortestechhelp
jcortes is offline  
Old 08-06-2006, 10:01 PM   #3 (permalink)
Monster Techie
 
Join Date: Dec 2003
Posts: 1,084
Send a message via Yahoo to IBMan
Default

syntax as well as examples would be awesome, thank you.

I'm sure i could figure it out but i'm confused at how to implement the computer name part.
__________________
Server:
AMD Athlon 4000+ @ 2.4 GHz
4096 MB RAM
40 GB HDD
Dual Mirrored 500 GB HDDs
DVD-ROM Drive
Windows Server 2003 x64 R2 SP2
IBMan is offline  
Old 08-06-2006, 10:05 PM   #4 (permalink)
Monster Techie
 
Join Date: Apr 2005
Posts: 1,909
Send a message via AIM to jcortes
Default

IF computer name is mmdc *you will need to put the code here that finds what the computername is you should have that already * (
install
) ELSE (
dont install
)
__________________

AIM = jcortestechhelp
jcortes is offline  
Old 08-06-2006, 10:06 PM   #5 (permalink)
Monster Techie
 
Join Date: Apr 2005
Posts: 1,909
Send a message via AIM to jcortes
Default

you can actually make it where you dont need the second argument all you have to do is say IF computername is mmdc then install and you dont need the else because it will not run the install if it doesnt meet the argument.
__________________

AIM = jcortestechhelp
jcortes is offline  
Old 08-06-2006, 10:07 PM   #6 (permalink)
Monster Techie
 
Join Date: Dec 2003
Posts: 1,084
Send a message via Yahoo to IBMan
Default

yea I don't know how to implement that, lol that's where im really stuck.
__________________
Server:
AMD Athlon 4000+ @ 2.4 GHz
4096 MB RAM
40 GB HDD
Dual Mirrored 500 GB HDDs
DVD-ROM Drive
Windows Server 2003 x64 R2 SP2
IBMan is offline  
Old 08-06-2006, 10:11 PM   #7 (permalink)
Monster Techie
 
Join Date: Apr 2005
Posts: 1,909
Send a message via AIM to jcortes
Default

oh so you need the full code for having it get the computer name then checking if its the same and installing it if it is?
__________________

AIM = jcortestechhelp
jcortes is offline  
Old 08-06-2006, 11:21 PM   #8 (permalink)
Monster Techie
 
Join Date: Dec 2003
Posts: 1,084
Send a message via Yahoo to IBMan
Default

yes, i need like the whole thing

the actually command i'd need it to run would be

"\\fs1\reminst\install\dotnetfx.exe /An"
__________________
Server:
AMD Athlon 4000+ @ 2.4 GHz
4096 MB RAM
40 GB HDD
Dual Mirrored 500 GB HDDs
DVD-ROM Drive
Windows Server 2003 x64 R2 SP2
IBMan is offline  
Old 08-06-2006, 11:24 PM   #9 (permalink)
Monster Techie
 
Join Date: Apr 2005
Posts: 1,909
Send a message via AIM to jcortes
Default

hmmm im not sure if you can do that in a batch file you might have to write a simple C++ program im not even sure how you would transfer the computer name into a veriable or i could make you the batch file myself but im not sure its possible. try posting this in the programming and networking section see if someone can help you there this one has me stumped let me know if you do figure it out im really interested to know.
__________________

AIM = jcortestechhelp
jcortes is offline  
Old 08-06-2006, 11:26 PM   #10 (permalink)
Monster Techie
 
Join Date: Dec 2003
Posts: 1,084
Send a message via Yahoo to IBMan
Default

alright, thanks. I'll wait a few days and post it in some other forums.
__________________

__________________
Server:
AMD Athlon 4000+ @ 2.4 GHz
4096 MB RAM
40 GB HDD
Dual Mirrored 500 GB HDDs
DVD-ROM Drive
Windows Server 2003 x64 R2 SP2
IBMan is offline  
Closed Thread

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

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




Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -5. The time now is 02:32 AM.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.