batch file help

Status
Not open for further replies.

IBMan

Daemon Poster
Messages
1,084
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.
 
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.
 
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.
 
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
)
 
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.
 
yea I don't know how to implement that, lol that's where im really stuck.
 
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?
 
yes, i need like the whole thing

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

"\\fs1\reminst\install\dotnetfx.exe /An"
 
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.
 
Status
Not open for further replies.
Back
Top Bottom