Skip to content

Stephen Hackers Blog

Infrastructure & Cyber Security Technical Architect

  • Home
  • Stephen Hackers

Tag IfNot

  • Home
  • If Not Exists – Batch Script
02/10/2018

If Not Exists – Batch Script

By Steve inBatch Scripts and PowerShell, Microsoft, Microsoft Windows Server 2008, Microsoft Windows Server 2012 Tag Batc, IfNot

Create a batch file to check a text file is in the location specified, else run a task.

 

#This batch file checks to see if a text file is in a location, if it does not, then launch notepad.exe

Create IfNot.bat
Add the following :

If NOT exist “C:\Temp\IsThisFileHere.txt”\ (

notepad.exe
)
exit

Recent Posts

  • PowerCLI with a GUI – Clone a machine, add DHCP…
  • New Course & Exam Announcements in October
  • Exam PASSED – Managing Microsoft Teams MS700
  • VMware Horizon and Zero Clients Enabling Rapid…
  • VMware Horizon and Zero Clients Enabling Rapid Remote Secure IT Working
  • vSphere 7 with Kubernetes – Getting Started Guide
  • Security Is a Hugely Strategic Area For VMware:…
  • VMworld 2020 registration is now open!
  • Microsoft Azure Security – Study Notes
  • MS365 – Azure AD – Dynamic Groups and Expiration Settings
  • Office 365 Security and Compliance – Alert When A Specific File Is Accessed
  • Content Search – Security And Compliance – Search A Mailbox For Specific Content And Then Export Results
  • MS 365 Compliance Admin Portal Error – Status code: 503
  • MS-101: Microsoft 365 Mobility and Security – EXAM PASSED!!!
  • Microsoft 365 – Audit Log Search – UserLoginFailed

Categories

VMware vExpert Security 2020

Microsoft Certified Azure Security Engineer Associate

VMware vExpert (5 years)

Certified Ethical Hacker

Microsoft Certified Azure Administrator Associate

VMware vExpert 2020

MCP 365 Mobility and Security

Symantec Certified Specialist

MCP 365 Identity and Services