I'm using the following code:
Dim start_info As New ProcessStartInfo("gci 'C:\Program Files\MyFolder\MyApp\' | Unblock-File") With {.UseShellExecute = False, .CreateNoWindow = True, .WindowStyle = ProcessWindowStyle.Hidden}
Dim pro As New Process With {.StartInfo = start_info}
pro.Start()
pro.WaitForExit()
MessageBox.Show("Unblock Files Exit Code: " & pro.ExitCode, "Exit " & "Code", MessageBoxButtons.OK, MessageBoxIcon.Information)
If I type the command (gci 'C:\Program Files\MyFolder\MyApp' | Unblock-File) in Win PowerShell all works well, but if I run the code I get "System.ComponentModel.Win32Exception: 'The system cannot find the file specified'" error.
Could anybody please help? Thank you.