Install only if it wasnt installed before

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
xionhack
Posts: 2
Joined: 08 Jun 2010 08:19

Install only if it wasnt installed before

#1 Post by xionhack » 13 Oct 2010 14:48

Hello. I made a script for Group Policy that would create a TEMP folder in the C drive, download a file from the server and install it. The only thing is that I only want it to be installed if the file wasnt installed before, maybe if it wasnt downloaded. This is my script. Thank you:

@echo off

echo ### Creating TEMP directory...
mkdir "C:\TEMP"


echo ### Downloading Software Manager
echo n|copy /-y "\\serverNETLOGON\setupInstall.exe" "C:\TEMP"


echo ### Installing Software manager
C:\TEMP\setupInstall.exe -server setup.server2.com -quiet

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Install only if it wasnt installed before

#2 Post by aGerman » 16 Oct 2010 06:34

The question is how you could determine if you have installed it before? Is there a file or folder created that only exists if it is installed? Or is there a registry key we could look for?

Regards
aGerman

Post Reply