Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
windows 98 batch file
Name: pswauger Date: April 6, 2005 at 11:37:39 Pacific OS: Windows 98 CPU/Ram: P4 512MB
Comment:
I am trying to capture the first word of a text file to a variable. I can do it fine in Windows NT, but cant seem to get it in Windows 98. I am using some third party utilities to try to do this (sed.exe and sv2.exe). This is what i have so far, but I cant get it to work
sed -n 1p folder~1.txt|sed "s/^ *//;s/ .*$//">fname.txt type fname.txt|s2v lname
Any assistance would be extremely helpful. Thanks.
Name: Mechanix2Go Date: April 6, 2005 at 12:21:36 Pacific
Reply:
Hi Pete,
Get the prefix utility here:
http://www.golden.triangle.com/PREFIX.ZIP
and use this BAT:
::** @echo off > quit.bat
prefix "setter " < myfile.txt > my.bat
> setter.bat echo set MYvar=%%1
my ::**
HTH
M2
If at first you don't succeed, you're about average.
0
Response Number 2
Name: pswauger Date: April 6, 2005 at 16:23:48 Pacific
Reply:
I cant get this to work.
0
Response Number 3
Name: Mechanix2Go Date: April 6, 2005 at 22:39:49 Pacific
Reply:
What does it do?
Or what does it not do?
M2
If at first you don't succeed, you're about average.
0
Response Number 4
Name: dtech10 Date: April 8, 2005 at 09:28:56 Pacific
Reply:
Hi Pete You seem to be having a problem getting the first word of a text file. I do'nt know why the existing programs do'nt work. I could write a C program to do this, but if you want a batch file for Win98 to do this it alot more difficult to write.
Whats in the text file? there's no ":" ">" and "<" charactors that may cause problems. Is the text seperated by spaces or is it the only word on the first line.
What name do you want for the Environment Variable.
0
Response Number 5
Name: pswauger Date: April 8, 2005 at 13:01:25 Pacific
Reply:
I found a different utility to do it with. XSet.exe
Summary: What is the batch command, if any, to close the DOS window after the batch file is complete? I am running Win 95 and am using batch files to apply patches silently: However, when the batch process is...
Summary: Hi Xplicit, you are asking a Windows XP batch file programming + Windows XP registry question, but this is DOS forum. So you have asked your question in a *wrong* forum. Please note that Windows XP do...
Summary: I want to copy files onto either Win9x or Win2K computers with a single batch file. The files will be copied into different locations depending on the OS. The batch file needs to identify which OS exi...