loginscripts.info
from Sembee Ltd.
UK MS Exchange Consultants
 

Page Last Updated: 21/02/2010
Checking for Existence of a File or Directory

This information was originally on our community
site amset.info, and you may have been
redirected to this site by following a link to a URL
on that domain. This is the same information, from
the same source, just in a new location.

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"


About this site

This information originally started life as a page on amset.info, our community assistance site. However that site is targeted at Microsoft Exchange server, as Sembee Ltd. is a Microsoft Exchange consultancy. Therefore it was moved to its own domain in early 2010. Traffic from amset.info is directed here.

Other sites that are owned and operated by Sembee Ltd include kbsearch.info, certificatesforexchange.com, dosprompt.info, office-recovery.info, wuauclt.info, blog.sembee.co.uk, exbpa.com and amset.info.


More Content from Sembee Ltd.
 
Resources on amset.info Other Sites Sembee Ltd.
Microsoft Exchange Command Prompt Getting Started Guide Microsoft Exchange Consultancy
Microsoft Outlook Login Scripts Director's Blog
Network Administration MS Exchange Resources  
Internet Explorer Knowledge Base search  
Microsoft Windows Recovery of MS Office content from Temp Files  
Microsoft Windows Mobile Troubleshoot the Automatic Updates Client  
Amazon Store UK ISP Status Pages  

© Sembee Ltd. 1998 - 2010.

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 on this site. This site is to provide guidance only and as such we cannot be held responsible for any consequences of following the advice given.