I'm running a batch file within PowerShell. It calls up another program to do a bunch of maps which it outputs to a subfolder called "GRD"
I then want to rename the files in the GRD folder by adding spaces " " where there are underscores "_", so I'm using the PoweShell command:
DIR | Rename-Item -NewName { $.name -replace ""," " }
This line works fine if I type it into the PS command window after I've run my batch file. But is there a way that I could incorporate this line into the end of my batch file? I've tried:
cd GRD
DIR | Rename-Item -NewName { $.name -replace ""," " }
But i get the error:
C:\Data\GRD>DIR | Rename-Item -NewName { $.name -replace ""," " }
'Rename-Item' is not recognized as an internal or external command, operable program or batch file.
No comments:
Post a Comment