Need a simple batch file that creates a file then checks for it on each run

Posted on 2004-10-22
Medium Priority
Last Modified: 2010-04-14
Need a simple batch file that checks for the file c:\running.txt.  If not there it creates it then continues.  If it finds the file, it exits.
Question by:murryc
LVL 11

Accepted Solution

KaliKoder earned 200 total points
ID: 12385537
Here is one:

REM  Do things if flag file is not there, exit if its there
set OSJOBLOG=C:\running.txt
if exist %OSJOBLOG% goto :END
echo test_ok>>C:\running.txt
echo Batch File Job Complere

Author Comment

ID: 12385941

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
Cloud is selling like hotcakes in the town. Technology lovers and even businesses have joined the wagon to taste a piece of this delicious technology treat. But how many of us really know what cloud is?
SQL Database Recovery Software repairs the MDF & NDF Files, corrupted due to hardware related issues or software related errors. Provides preview of recovered database objects and allows saving in either MSSQL, CSV, HTML or XLS format. Ensures recov…
The video will let you know the exact process to import OST/PST files to the cloud based Office 365 mailboxes. Using Kernel Import PST to Office 365 tool, one can quickly import numerous OST/PST files to Office 365. Besides this, the tool also comes…
Suggested Courses
Course of the Month4 days, 23 hours left to enroll

601 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question