Tech Support Guy banner
Not open for further replies.
1 - 2 of 2 Posts

1 Posts
Discussion Starter · #1 ·
Hi guys,

I have written the below batch file which basically copies a folder of folders from the server to each users desktop. It works fine. However I want to add in a condition that only copies the files if:

C:\Program Files\Microsoft Business Solutions\Great Plains actually exists on the users desktop. So it will only copy files to people who have Great Plains installed, and for others who dont have it installed, it wont copy the files to them. I am thinking its a basic if/then/else but i dont know how to do it.

Eg. If the Great Plains folder exists, do the batch file, if it doesnt exist, dont do the batch file...thats all i want.

Anyone know how to do this?




SET _source=\\tberp\GP\

SET _dest="C:\Program Files\Microsoft Business Solutions\Great Plains"

SET _what= /B /SEC
:: /B :: copy files in Backup mode.
:: /SEC :: copy files with SECurity

SET _options=/R:0 /W:0 /LOG:MyLogfile.txt /NFL /NDL
:: /R:n :: number of Retries
:: /W:n :: Wait time between retries
:: /LOG :: Output log file
:: /NFL :: No file logging
:: /NDL :: No dir logging

ROBOCOPY %_source% %_dest% %_what% %_options%
1 - 2 of 2 Posts
Not open for further replies.