Powershell > output on specific path -


i have make script in powershell :

$msbuild = "$env:appdata\usbsave\usb.exe"  $arguments = " -w "  start-process $msbuild $arguments  

the script works, output file (out.txt), appears on desktop.

how can save output file $env:appdata\usbsave\ ?

i assume console prompt pointing desktop. simple solution change directory before calling process.

$msbuilddir = "$env:appdata\usbsave" set-location $msbuilddir $msbuild = "$msbuilddir\usb.exe"  $arguments = "all -w"  start-process $msbuild $arguments  

i consider usb.exe have switches define output. more commonly associated virus seems utility.

was going mention -workingdirectory start-process tony hinkle beat me it.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -