|
I am learning the variables stuff but do not completly understand it. I have multiple offices with different templates for their city. I want to add to my login script so if the user does not have the templates based on their everyone group they will be copied. I would like to list all of the files incase one gets delete that one will get copied. This is what I have so far.
$CIN0 = "\\server\share\TEMPLATES\*.*" $CIN1 = "\\server\share\TEMPLATES\1CN_ENVBLANK.DOT" $CIN2 = "\\server\share\TEMPLATES\1CN_ENVELOPE.DOT" $LPC0 = "%appdata%\MICROSOFT\TEMPLATES\" $LPC1 = "%appdata%\MICROSOFT\TEMPLATES\1CN_ENVBLANK.DOT" $LPC2 = "%appdata%\MICROSOFT\TEMPLATES\1CN_ENVELOPE.DOT" IF NOT EXIST ("$LPC1") <> 0 COPY "$CIN1" "$LPC0" ELSE ? "YOU HAVE TEMPLATES" ENDIF IF NOT EXIST ("$LPC2") <> 0 COPY "$CIN2" "$LPC0" ELSE ? "YOU HAVE TEMPLATES" CINCINNATITEMP
I noticed that if I use multiple if statments it gets very complicated. Can I use something like IF NOT EXIST ("$lpc1") ("$LPC2") etc? - So I would only have one if statement? Would this copy the one variable if missing? Also how can I use IF INGROUP ("CINEVERYONE") to apply this template to only the people in this group? Thanks for the help.
|