Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi
I'm trying to run a simple powershell command through (command "_shell" ...) to change .txt file encoding
(setq dwgx (getvar 'dwgprefix))
(setq geox (getfiled "TRW Geocoding file" dwgx "txt" 0))
(setq geox-utf8 (vl-string-subst "-utf8.txt" ".txt" geox))
(setq str (strcat "Powershell.exe Get-Content -Path " geox " | Out-File -FilePath " geox-utf8 " -Encoding ascii"))
(command "_shell" str)
When I pass the string to the _shell command, it just returns nil, and the file is never created.
However when I enter it inside a standalone powershell window (Get-Content -Path [path] | Out-File -FilePath [utf8 path] -Encoding ascii) a new .txt file with the proper encoding is created. (Works even without quotes, the path doesn't contain spaces).
Any hints?
Solved! Go to Solution.