loginscripts.info
from Sembee Ltd.
UK MS Exchange Consultants
 

Page Last Updated: 24/04/2011
Checking for Existence of a File or Directory

A useful technique is to check for the existence of a file or directory. You can then set actions on the result. This could be copying an update across, running an another application or just recording that something is installed. This can be achieved using the built in command line tools, as per the same script below.

In both examples the script will move on to the ":next" if the file or directory is found. You could change the "if exist" to "if not exist" if you want the script to react to something being missing as an alternative.

Checking for a file

In this example, the script is checking for a file called "content.txt" in the directory "example".

Checking for a Directory

This sample is checking for a directory called "content" which is a sub directory of "example"


More Content from Sembee Ltd.
 
Resources on exchange.sembee.info Other Sites Sembee Ltd.
Microsoft Exchange 2003 Command Prompt Getting Started Guide Microsoft Exchange Consultancy
Microsoft Exchange 2007 Login Scripts Director's Blog
Microsoft Exchange 2010 MS Exchange Resources  
Microsoft Outlook Knowledge Base search  
Exchange Networking Tasks Recovery of MS Office content from Temp Files  
Amazon Store Troubleshoot the Automatic Updates Client  
  UK ISP Status Pages  
© Sembee Ltd. 1998 - 2011.
Reproduction of any content on this web site is prohibited without express written consent. Use of this web site is subject to our terms and conditions. All trademarks and registered trademarks are property of their respective owners. This site is not endorsed or recommended by any company or organisation mentioned within and is to provide guidance only and as such we cannot be held responsible for any consequences of following the advice given.

Sembee Ltd. is registered in England and Wales at 33 Scrivens Mead, Thatcham, Berkshire, RG19 4FQ.
Registered company number: 4704428. VAT Number GB 904 5603 43.