Skip to content

Stephen Hackers Blog

Infrastructure & Cyber Security Technical Architect

  • Home
  • Stephen Hackers

Tag Batc

  • 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

  • Setup a Microsoft 365 Developer subscription with E5 License – 90 days Rolling
  • Join the Developer 365 Program – Includes E5 License – 90 days Rolling
  • Azure Conditional Access Integration with Google Chrome
  • Block Downloads In MS TEAMS Thick Client For Non Managed Computers
  • Block Access From Unmanaged Devices To SharePoint or Specific Sites
  • How to Enable “Security Defaults” in Azure and Office 365
  • 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

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