Bat Command from Powershell

By polfilm,

  Filed under: Powershell
  Comments: None

This way you don’t have to worry about escaping anything.

$command = @'
cmd.exe /C c:\windows\system32\ntbackup.exe backup "C:\Documents and Settings\Administrator\Local Settings\Application Data\Microsoft\Windows NT\NTBackup\data\chameme.bks" /n "1file.bkf1 created 06/09/2013 at 09:36" /d "Set created 06/09/2013 at 09:36" /v:no /r:no /rs:no /hc:off /m normal /j chameme /l:s /f "\\fs1\Exchange Backups$\1file.bkf"

Invoke-Expression -Command:$command

Be the first to write a comment.

Your feedback

You must be logged in to post a comment.