Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Basic File Operations

Status
Not open for further replies.

Raabi2

Technical User
Jan 8, 2013
1
DE
Hi everybody!

This is my very first post on this forum. I have fair knowledge of programming, but I am an ultimate beginner to the Windows PowerShell. I just want to take a start of using the PowerShell by transforming a very simple Batch files, of mine, into psl. I hope some good soul will guide me through the process. Follwing is my Batch file code:
Code:
In Not Exist "mySample.ini" goto Step2

Del mySample.ini

Echo The file has been deleted.

:Step2

myExefile

Exit

:End

Please help!

Raby
 
Use test-path to check to see if file exists. If so then use remove-item to delete it. then use invoke-expression to run command.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top