中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-05 04:22
48,038 topics / 350,123 posts / today 0 new / 48,251 members
DOS批处理 & 脚本技术(批处理室) » How to classify files according to the status of TAR files?
Printable Version  2,205 / 22
Floor1 joshualaw Posted 2007-06-13 22:23
初级用户 Posts 62 Credits 132
Dear experts:

Please help me write a batch processing that can implement the following functions.

1. Suppose there are many .TAR files in the C:\log folder (compressed files), and each .TAR file has only one state, either TP or TF (you can tell from the .TAR file)

2. To distinguish the .TAR files with TP or TF, for example: move the .TAR files with TF to the C:\log\TF\ folder,

3. Since the original .TAR file cannot be attached, only the content of the .TAR file is attached here for your reference
************************************************************
SBS7152297IB
CWHP
BWHP UI
Nhuawhpfct11
PFVT
s0
D2217.scr
R???
nW10110641
rREL
OC900260
L29
p11
W???

06/01/07 20:13:36
TF
FWRCVP_Disable Heartbeat
>WIDE_RECEIVE_PACKET (Disable Heartbeat Broadcast packet)
>RcvPacket() returned an error
>Timeout getting packet byte
MWide_FW_Version
d0x11
************************************************************

[ Last edited by bjsh on 2007-7-31 at 02:28 PM ]
Floor2 wudixin96 Posted 2007-06-13 22:39
银牌会员 Posts 931 Credits 1,928
Does the LZ mean that as long as the TAR file contains TF, it is put into the TF folder, and if it contains TP, it is put into the TP folder?
Floor3 joshualaw Posted 2007-06-13 22:46
初级用户 Posts 62 Credits 132
Yes, can it be done? Thank you for your timely reply
Floor4 wudixin96 Posted 2007-06-13 23:13
银牌会员 Posts 931 Credits 1,928
I'm not familiar with TAR files at all. I only know they are compression files under Linux.

How was the content of the owner's file extracted?

Is it the file name or just the text content?
Floor5 joshualaw Posted 2007-06-13 23:26
初级用户 Posts 62 Credits 132
First, point to the.TAR file, then right-click the mouse and select Notepad to open. It looks like a compressed file on the surface, but actually the content is text content
Floor6 wudixin96 Posted 2007-06-14 00:34
银牌会员 Posts 931 Credits 1,928
This can be referred to.

I assume there are many text files in the current folder, and they only contain "TF" or "TP" characters.
Floor7 joshualaw Posted 2007-06-14 15:05
初级用户 Posts 62 Credits 132
First, thank you to the experts. The basic functions can be realized, but the.TAR files containing TP or TF characters cannot be accurately distinguished 100%. For example, the following two filenames of.TAR files are found temporarily. Their contents contain TP characters, but they are still placed in the folder with TF. Can you help me study it again? Thank you first.

RE0724000R5CA(6-13-2007 16-3-38).TAR ---> is the file name

KM107230000JLA(6-9-2007 12-41-29).TAR---> is the file name
Floor8 wudixin96 Posted 2007-06-14 15:18
银牌会员 Posts 931 Credits 1,928
Mistake, forgot to ask the thread starter if the file name contains spaces. Hehe
Similar to
Not tested, just take a look first.
Floor9 joshualaw Posted 2007-06-14 20:56
初级用户 Posts 62 Credits 132
The file name is the same as other file names, (this file name is generated automatically by the system), also tried the latest one you just gave me but it still doesn't work. Can it be convenient to give me your email address? I will send you the relevant.TAR files to help me take a look because I don't know how to attach those files here. Thanks in advance!
Floor10 wudixin96 Posted 2007-06-15 00:06
银牌会员 Posts 931 Credits 1,928
Click the quote reply to add an attachment.


[ Last edited by wudixin96 on 2007-6-15 at 10:56 AM ]
Floor11 joshualaw Posted 2007-06-15 14:53
初级用户 Posts 62 Credits 132
I tested it, and for the time being, no problems were found. Still, the experts are amazing! I'm really too stupid. Experts, now there's another question I'd like to ask. When a normal batch file runs, a black window flashes in front of the screen. Is there a way to make the batch file run in the background, without a black window flashing in front of the screen? Please give me some advice.
Floor12 wudixin96 Posted 2007-06-15 15:03
银牌会员 Posts 931 Credits 1,928
Brother, you're overpraising. Actually, I'm also a newbie. Just started learning.

To hide the running batch processing, please use the "Search" function of the forum.
Floor13 lililulula Posted 2007-06-15 16:34
中级用户 Posts 138 Credits 302
set batname=WScript.CreateObject("WScript.Shell")
batname.run "batpath",0

Just save it as a VBS script and run it.

[ Last edited by lililulula on 2007-6-15 at 04:35 PM ]
Floor14 joshualaw Posted 2007-06-15 16:50
初级用户 Posts 62 Credits 132
The meaning of floor 13 I still don't understand. Can you explain it in detail? I mean I use Windows--->Control panel-->Scheduled Task to schedule a time to run this batch regularly. When it runs, is there a way to make the batch run in a hidden way or other ways, in short, don't let people see the black screen flashing.
Floor15 lililulula Posted 2007-06-15 17:09
中级用户 Posts 138 Credits 302
Save the above code as a VBS file. In the code, `batpath` is the absolute path of your bat file, and then run this VBS script in the task scheduler
1 2  Next
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023