Cut first 190chars of text file

October 8, 2012 at 06:50:55
Specs: Windows Server 2008 R 2 standard 64bit
Hi all,
I ran batch file from nbrane but it doesnot works on Windows Server 2008 R 2 Standard 64 BIT
@echo off & setLocal enableDELAYedeXpansioN
if not exist source.txt echo no file && goto :eof
set file=source.txt
(echo a190
echo sub cx,be
echo int 3
echo g=190
echo w1be
echo q ) | debug %file% > nul
I got 'debug' is not recognized as an internal or external command, operable program or batch file.
I need this script run on Windows Server 2008 R 2 64 bit.
Please advice. Many thanks

See More: Cut first 190chars of text file

Report •

October 8, 2012 at 08:51:05
DEBUG is a legacy tool inherited from DOS age aimed to manipulate 16 bit code. Since 64bit operating systems do not support 16bit code any more, DEBUG is no more available. That explains the message you got. Sorry you have to try another way.

Report •

October 8, 2012 at 18:47:35
@IVO: yeah, M2 warned me that DEBUG was no longer supported my MS. I will use "symdeb" as long as i can, but of course, that counts as "third party".

@op: here's hybrid batch + vbscript solution, maybe:

::====== begin batch
@echo off & setlocal
::===== begin vbscript sub-script creation
> t.vbs (
echo set fso=createobject("scripting.filesystemobject"^)
echo c=mid(fso.opentextfile("source.txt",1^).readall,191^)
echo fso.createtextfile("source.clp"^).write c
::===== execute vbscript subscript
cscript /nologo t.vbs
::===== end batchscript

Of course, the batch is just a "wrapper". You could as well just use vbscript as standalone.

Report •

October 9, 2012 at 02:53:29
I thought we fried this fish a month ago; without debug.

Post your requirement and maybe we still can.

Life is too important to be taken seriously.


Report •

Related Solutions

October 9, 2012 at 17:32:57
@M2: yeah, i think i advised alex that vbscript was the best solution on the first go-round. Not sure why he went with "debug", but, "you'll have that" Lol!

Report •

Ask Question