You are not logged in.
Pages: 1
On Windows 7 64-bit, when XCOPY is executed from a TextPad 64-bit tool, it silently fails.
Code:
REM Run on TP 8.1.1 (64-bit edition) as tool http://i.imgur.com/HZ47pWM.png
echo test > %TEMP%\src.bat
del /q %TEMP%\dest.bat
xcopy %TEMP%\src.bat %TEMP%\dest.bat
dir /b %TEMP%\dest.bat
REM Expected: 1 File(s)
REM Observed: File not found
When run outside TP, I get success as expected EDIT: http://i.imgur.com/WpRRDgx.png (faulty screenshot)
With XCOPY replaced by COPY, I get success as expected http://i.imgur.com/eyCMJb9.png .
Any ideas?
Last edited by chrisjj (15 Oct 2018 12:32)
Offline
Does it work if you run it outside of TextPad?
Does it work if you run it as a .CMD rather than .bat?
Is there an XCOPY.bat or XCOPY.cmd file in the temp folder?
Offline
Does it work if you run it outside of TextPad?
Yes (as I said: "When run outside TP, I get success as expected EDIT: http://i.imgur.com/WpRRDgx.png (faulty screenshot) ).
Does it work if you run it as a .CMD rather than .bat?
No. Same fail.
Is there an XCOPY.bat or XCOPY.cmd file in the temp folder?
No.
Thanks.
Last edited by chrisjj (15 Oct 2018 12:32)
Offline
Well I don't know, it could be that 64 bit TextPad is launching a 32 bit cmd session, but even that shouldnt stop XCOPY from running.
Offline
From TP, PROCESSOR_ARCHITECTURE% is AMD64, and %PROCESSOR_ARCHITEW6432% is empty.
I guess that means TP's CMD session is 64-bit.
Offline
I was able to replicate your issue on Windows 7 64-bit with TextPad 8.1.2. After a bit of testing, I speculated that the error was a result of xcopy asking if the destination was a file or folder, so I changed the xcopy line to
echo f | xcopy "%TEMP%\src.bat" "%TEMP%\dest.bat"
and that worked.
Offline
I was able to replicate your issue on Windows 7 64-bit with TextPad 8.1.2. After a bit of testing, I speculated that the error was a result of xcopy asking if the destination was a file or folder, so I changed the xcopy line to
echo f | xcopy "%TEMP%\src.bat" "%TEMP%\dest.bat"
and that worked.
Nice catch. That workaround succeeds here too:
Thanks.
But the 'f' is locale specific, meaning the solution is not robust. so I tried explicitly specifying the destination is a file by appending an asterisk, but the result was still fail:
and still success outside TP:
Any idea why?
Offline
Update: XCOPY /? shows the same!
Outside TP, OK: https://i.imgur.com/FACCYOs.png
Inside TP, fail:
Last edited by chrisjj (15 Oct 2018 13:07)
Offline
This is pretty clearly an issue with Textpad. I'd recommend using something else.
Last edited by Shadow Thief (15 Oct 2018 20:46)
Offline
I was able to replicate your issue on Windows 7 64-bit with TextPad 8.1.2. After a bit of testing, I speculated that the error was a result of xcopy asking if the destination was a file or folder, so I changed the xcopy line to
echo f | xcopy "%TEMP%\src.bat" "%TEMP%\dest.bat"
and that worked.
That is an interesting finding, but it still doesnt explain why it works without TextPad.
My suspicion is that TextPad is messing up the line endings to something other than CR/LF
FWIW theres a workaround for the file/folder issue on the XCOPY page, but if the line endings are wrong you will still get all number of other bugs appearing.
Offline
A workaround:
echo | xcopy /y %TEMP%\src.bat %TEMP%\dest.bat*
And mysteriously:
echo | xcopy /?
Last edited by chrisjj (15 Oct 2018 23:55)
Offline
Pages: 1