Nice to know.
However, the WMIC method fails as presented. The
Copying the executable to
However, the WMIC method fails as presented. The
for
statement does not like parentheses in the pathname [C:\Program Files (x86)\WinSCP\WinSCP.exe
] though it works if I change Program Files (x86)
to progra~2
- not an option because I don't know that's the case on all machines this script runs on, though it should be.... The PowerShell and makecab methods are far longer than I wanted to spend in these scripts...
Copying the executable to
c:\temp\
first and pointing wmic
at that copy takes a second, but it's faster than opening a connection, and it works. Escaping the closing parentheses in the pathname also works: C:\\Program Files (x86^)\\WinSCP\\WinSCP.exe
. Oddly, it doesn't need to have the opening paren escaped, too...