Thursday, February 26, 2009

Powershell Encoding - Grep

I was writing something where powershell ran on the remote host and copied files to a second box. On the second box I would run a perl script and take any any lines containing "Time:" "Finished zone:", had trouble.

Found out that
cmd - "dnscmd /zoneprint zonename.com > zone-zonename.com.txt "
powershell - "dnscmd /zoneprint zonename.com > zone-zonename.com.txt "

give files with different encoding.

I ended up using | Out-file -Encoding utf8 zone-zonename.com.txt

Getting the path of a running Batch file

Found on this blog, the trick
echo %~dp0.

Vmware ESX 3.5 unable to mount DVD ISO

I was trying to mount a Windows 2008 DVD ISO file that someone else had downloaded, it was giving an error.

Found one some other blog the answer could be one of two things, shorten the name (MS downloads have really long names, or change the .ISO to lowercase .iso.( this is what worked for me.)

Monday, February 02, 2009

custom command prompt

Found a great article.

How to Create a Custom Windows Command Prompt
http://www.wikihow.com/Create-a-Custom-Windows-Command-Prompt



I went searching for this as the path is too long and then the command line is hard to read.

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment]
"PROMPT"="$P$_$G"