Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
I am trying to get
echo drive >drive.txt
to put the word "drive" into the drive.txt without the space and new line after it ?? I am trying to get "drive" on the first line of the text document with nothing after it !!
Please, any help would be very much appreciated.
Fight Crime,
Shoot Back !

No can do without external commands.
::==================
@echo off > d.d>> d.d echo e 100 "set myvar="
>> d.d echo n setmyvar.bat
>> d.d echo rcx
>> d.d echo a
>> d.d echo w
>> d.d echo q
debug < d.d
::=====================
=====================================
If at first you don't succeed, you're about average.M2

Ok, I copied M2's code into a test batch file and ran it with different things in the "" space.
@echo off > d.d
>> d.d echo e 100 "j"
>> d.d echo n drive.bat
>> d.d echo rcx
>> d.d echo a
>> d.d echo w
>> d.d echo q
debug < d.dgave
j¿Œ™‹÷ƒÆ‹
as the output. But this...
@echo off > d.d
>> d.d echo e 100 "set drive="
>> d.d echo n drive.bat
>> d.d echo rcx
>> d.d echo a
>> d.d echo w
>> d.d echo q
debug < d.dgave
set drive=
with no spaces or anything after it !! Exactly what I am after except for the single drive letter.
It would be perfect if
set usbdrive=j
@echo off > d.d
>> d.d echo e 100 "set drive=%usbdrive%"
>> d.d echo n drive.bat
>> d.d echo rcx
>> d.d echo a
>> d.d echo w
>> d.d echo q
debug < d.dwhere
set drive=j
is the output string !!
Is it possible ?? Thanks
Fight Crime,
Shoot Back !

Well... almost.
The point of using debug is to create a file without a line break. So you can:
copy file1+file2 file3
and have it all on one line. [That's what you asked.]
But if you've got %usbdrive% set you can simply:
echo set drive=%usbdrive%>some.bat
But we're going in circles. I'll let you decide which thread to continue this in.
=====================================
If at first you don't succeed, you're about average.M2

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |