I need to changed directory using batch file in PowerShell.
Let's say the batch file named go.bat has the two lines of code. And I'm in q: directory.
c:
cd c:\abc\def
When I run go.bat, I'm still in q:
Solved
In Powershell, I needed to name the batch file extension as .ps1, with .bat, I got errors.
.ps1file is a PowerShell script, not what is commonly known as a batch (or command file) which is interpreted bycommand.exeand has a.bator.cmdfile extension. – martineau Mar 7 '12 at 22:13