Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources: Active Threads
Viewing all articles
Browse latest Browse all 8411

Write a command file using out-put has a weird first character

$
0
0

When I use the following statement:

write "rem Beginning " | Out-File -filepath c:\data\RecreateLogs.cmd -Force

The first character is not recognized and I get this error when I run the cmd file.

D:\Data>RecreateLogs.cmd

D:\Data>■p
'■p' is not recognized as an internal or external command,
operable program or batch file.

I've tried different -Encoding with no luck. Any ideas?


Viewing all articles
Browse latest Browse all 8411

Latest Images

Trending Articles



Latest Images