Error when using System.cmd

Yes, by calling Powershell instead of cmd and passing it the command/script with appropriate command line flags.