Submitted By: Kent Finkle

Uses Windows PowerShell to determine whether the file C:\Scripts\Heysguy.exe exists.

PowerShell
Edit|Remove
#  Script name:    FileExists.ps1
#  Created on:     2006-09-11
#  Author:         Kent Finkle
#  Purpose:        Check if a file exists with PowerShell.

if ([System.IO.File]::Exists("c:\scripts\heysguy.exe"))
{
    [System.Console]::WriteLine("exists");
}
else
{
    [System.Console]::WriteLine("does not exist");
}