China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-07 07:10
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Solved] Pure DOS Batch Processing Problem That Hasn't Been Resolved for More Than Half a Year View 2,538 Replies 31
Floor 16 Posted 2008-01-12 01:58 ·  中国 广东 广州 广东金万邦科技投资有限公司(新一代数据中心)IDC机房(BGP)
初级用户
Credits 72
Posts 31
Joined 2007-06-09 00:26
19-year member
UID 90742
Gender Male
Status Offline
I can directly use find to find the txt text, but it doesn't work with gdisk | find.
Finding "A01" in 1.txt is successful.
Failing when using gdisk | find "A01".

Can I use config.sys to make gdisk.exe output a txt file on drive A before entering the pure DOS command?
Floor 17 Posted 2008-01-12 02:07 ·  中国 广东 广州 广东金万邦科技投资有限公司(新一代数据中心)IDC机房(BGP)
初级用户
Credits 72
Posts 31
Joined 2007-06-09 00:26
19-year member
UID 90742
Gender Male
Status Offline
gdisk must be output on the screen or in drive A. I tried again. The | symbol probably can't be used? Even a statement like echo aaa | find "aaa" will go wrong. It has nothing to do with find or other issues. I've used N third-party search tools, all the same. As long as there's a |, it doesn't work. If you don't use |, you have to output to a txt file to search...
Floor 18 Posted 2008-01-12 02:22 ·  中国 江苏 常州 溧阳市 电信
银牌会员
★★★
Credits 2,404
Posts 946
Joined 2005-09-08 13:44
20-year member
UID 42345
Status Offline
It should be possible to use |
gdisk | lmod /L2 | find /i "A01"
if errorlevel 1 goto end
:go1
..................
:end

I don't know if the subsequent find can be omitted! Because there is a parameter in lmod that can directly write the A01 to be displayed in , such as: lmod /L2 (since I haven't used it, so I'm not sure) Then judge the return value, I don't know if it can work the same.

[ Last edited by terse on 2008-1-12 at 02:43 AM ]
简单!简单!再简单!
Floor 19 Posted 2008-01-12 10:22 ·  中国 安徽 马鞍山 电信
金牌会员
★★★★
Credits 3,946
Posts 1,884
Joined 2006-01-20 13:00
20-year member
UID 49283
Gender Male
Status Offline
The reason for the error is that the current drive letter is not writable. Just solve this problem.
Windows 一键还原
http://www.yjhy.com
Floor 20 Posted 2008-01-12 15:02 ·  中国 江苏 常州 电信
银牌会员
★★★
Credits 2,404
Posts 946
Joined 2005-09-08 13:44
20-year member
UID 42345
Status Offline
Please provide the Chinese content that needs to be translated. As the current content has both Chinese and English parts, please clarify which specific Chinese part needs translation. If it's the Chinese sentence "AUTOEXEC.BAT和CONFIG.SYS的内容看一下 估计在是哪个环节出问题", the translation is "Take a look at the contents of AUTOEXEC.BAT and CONFIG.SYS. Estimate which link is having a problem". The rest of the code part remains as is. So the full translated text would be:

Take a look at the contents of AUTOEXEC.BAT and CONFIG.SYS. Estimate which link is having a problem
Next, run lmod with the following test: you can also change it, replace A01 with something else
@echo off
gdisk | lmod /L2
if errorlevel 1 goto end
:go1
echo ok
goto exit
:end
echo no

[ Last edited by terse on 2008-1-12 at 03:47 PM ]
简单!简单!再简单!
Floor 21 Posted 2008-01-12 16:53 ·  中国 安徽 马鞍山 电信
金牌会员
★★★★
Credits 3,946
Posts 1,884
Joined 2006-01-20 13:00
20-year member
UID 49283
Gender Male
Status Offline
Originally posted by terse at 2008-1-12 15:02:
Take a look at the contents of AUTOEXEC.BAT and CONFIG.SYS. It is estimated that there is a problem in which link.
Next, run lmod with the following and try it. You can also change it. Replace A01 with something else.
@echo off
gdisk | lmod /L2 ...

Can it be used if the current drive is not writable?
Windows 一键还原
http://www.yjhy.com
Floor 22 Posted 2008-01-12 19:57 ·  中国 江苏 常州 溧阳市 电信
银牌会员
★★★
Credits 2,404
Posts 946
Joined 2005-09-08 13:44
20-year member
UID 42345
Status Offline
Originally posted by lianjiang2004 at 2008-1-12 16:53:

If the current drive is not writable, can it be used?

Ask the LZ to send the contents of AUTOEXEC.BAT and CONFIG.SYS for a look. The fact that the current drive is not writable is one aspect! But there may be other reasons! How does the LZ boot to DOS?
简单!简单!再简单!
Floor 23 Posted 2008-01-12 20:17 ·  中国 浙江 温州 龙湾区 电信
初级用户
★★
Credits 109
Posts 52
Joined 2006-01-03 22:47
20-year member
UID 48392
Status Offline
It seems that the main difficulty of the original poster is that there is no way to generate a txt temporary file. Isn't there something called a RAM disk? Use memory to virtualize a readable and writable disk, and then redirect the output to a txt file for processing.
Floor 24 Posted 2008-01-12 20:26 ·  中国 安徽 马鞍山 电信
金牌会员
★★★★
Credits 3,946
Posts 1,884
Joined 2006-01-20 13:00
20-year member
UID 49283
Gender Male
Status Offline
Originally posted by terse at 2008-1-12 19:57:

Ask the LZ to post the contents of AUTOEXEC.BAT and CONFIG.SYS for a look. The unwriteable current drive is one aspect! But there may be other reasons! What did the LZ use to boot into DOS?


On my forum, the original poster has said that it is because it is unwriteable, so it is necessary not to generate intermediate files. Otherwise, using intermediate files would be much simpler?
It's just that the original poster didn't clearly state the problem, causing everyone to be at a loss. Hehe.
Windows 一键还原
http://www.yjhy.com
Floor 25 Posted 2008-01-12 20:29 ·  中国 安徽 马鞍山 电信
金牌会员
★★★★
Credits 3,946
Posts 1,884
Joined 2006-01-20 13:00
20-year member
UID 49283
Gender Male
Status Offline
Unwritable, this is the key reason that prevents achieving everyone's intentions. If it's unwritable, any solution is in vain. Hehe.
Windows 一键还原
http://www.yjhy.com
Floor 26 Posted 2008-01-13 00:52 ·  中国 江苏 常州 溧阳市 电信
银牌会员
★★★
Credits 2,404
Posts 946
Joined 2005-09-08 13:44
20-year member
UID 42345
Status Offline
I thought that even if the current disk is not writable, the one at the 20th floor should be okay. It's just that there's no test environment, so I don't know if it works!
简单!简单!再简单!
Floor 27 Posted 2008-01-13 07:52 ·  中国 安徽 马鞍山 电信
金牌会员
★★★★
Credits 3,946
Posts 1,884
Joined 2006-01-20 13:00
20-year member
UID 49283
Gender Male
Status Offline
Originally posted by terse at 2008-1-13 00:52:
I thought that even if the current drive is not writable, my method at floor 20 should be feasible, but there is no test environment, so I don't know if it is feasible!


Personally, I think that for either solution, the current drive needs to be writable.

And this is also the key to the problem.
Windows 一键还原
http://www.yjhy.com
Floor 28 Posted 2008-01-13 19:49 ·  中国 四川 南充 营山县 电信
超级版主
★★★★
我爱DOS
Credits 5,310
Posts 2,044
Joined 2005-09-26 12:00
20-year member
UID 42843
Gender Male
From 四川南充
Status Offline
Floor 29 Posted 2008-01-13 23:14 ·  中国 山西 太原 联通
银牌会员
★★★
天的白色影子
Credits 2,343
Posts 636
Joined 2004-03-06 00:00
22-year member
UID 19350
Gender Male
Status Offline
Floor 30 Posted 2008-01-14 01:06 ·  中国 广东 广州 天河区 电信
金牌会员
★★★★
一叶枝头,万树皆春
Credits 2,564
Posts 1,127
Joined 2006-12-25 22:57
19-year member
UID 74552
Gender Male
Status Offline
gdisk is a partition tool included in Ghost 2k. When gdisk runs without parameters, it defaults to displaying the partition situation of the first disk in the current computer.
Forum Jump: