中国DOS联盟论坛

中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --

联盟域名:www.cn-dos.net  论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!

游客:  注册 | 登录 | 命令行 | 会员 | 搜索 | 上传 | 帮助 »
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » 求助:如何删除硬盘中的proe旧版本文件!!
« [1] [2] »
作者:
标题: 求助:如何删除硬盘中的proe旧版本文件!! 上一主题 | 下一主题
caiwei5566
初级用户





积分 48
发帖 19
注册 2006-11-27
状态 离线
『楼 主』:  求助:如何删除硬盘中的proe旧版本文件!!

本人用proe搞3D设计,proe每保存一次会生成一个新版本文件,如:旧版为aa.prt.1,新版为:aa.prt.2,依次向上,虽然软件中提供pruge.bat,在工作目录删除旧版文件,但日久的很多文件夹都会存在旧版文件,盼提供一快捷方法,一次清理掉某个盘中的旧版文件。

2006-12-18 09:35
查看资料  发短消息 网志   编辑帖子  回复  引用回复
namejm
荣誉版主

batch fan


积分 5226
发帖 1737
注册 2006-3-10
来自 成都
状态 离线
『第 2 楼』:  

  你所谓的旧文件,指的就是所有 aa.prt.XX 之类的文件吗?看了你的描述,不太确定你指的旧文件究竟是啥模样。另外,这些旧文件保存在什么位置?



尺有所短,寸有所长,学好CMD没商量。
考虑问题复杂化,解决问题简洁化。
2006-12-18 10:02
查看资料  发短消息 网志   编辑帖子  回复  引用回复
caiwei5566
初级用户





积分 48
发帖 19
注册 2006-11-27
状态 离线
『第 3 楼』:  

是啊,新版文件就是在aa.prt.x后加上1,总之新版文件的后缀名一定比旧版的大,如旧版可能是aa.prt.2,而新版的则是aa.prt.7,或更大。文件的存放很乱,可能有很多目录,在一个盘内。关键求一次性将这些旧版的清除掉。。。
这样在资料整理中很有实用价值。。。

2006-12-18 12:25
查看资料  发短消息 网志   编辑帖子  回复  引用回复
namejm
荣誉版主

batch fan


积分 5226
发帖 1737
注册 2006-3-10
来自 成都
状态 离线
『第 4 楼』:  

  也就是说,你需要在某个分区里搜索 aa.prt.数字 这样的文件是吗?并且只保留数字最大的那个文件?



尺有所短,寸有所长,学好CMD没商量。
考虑问题复杂化,解决问题简洁化。
2006-12-18 12:42
查看资料  发短消息 网志   编辑帖子  回复  引用回复
caiwei5566
初级用户





积分 48
发帖 19
注册 2006-11-27
状态 离线
『第 5 楼』:  

简单来说是这样,俺是菜鸟,求高人赐招。。。

2006-12-18 13:00
查看资料  发短消息 网志   编辑帖子  回复  引用回复
caiwei5566
初级用户





积分 48
发帖 19
注册 2006-11-27
状态 离线
『第 6 楼』:  

不是吧,没人知道啊,是难还是太容易啊。。。

其实有两个地方比较困难,一是文件所以的目录不定,所以要搜索后做分类比较。二是旧版本文件数不定,或有多个,或只有一个,如新版的是:文件名.prt.7,而旧版的的可能为:文件名.prt.5,文件名.prt.3等。

下面附上proe程序正带的在工作目录清除的批处理,但是一次只能清一个目录,而不能全盘清理。
文件所在目录为:E:\Program Files\proeWildfire 3.0\bin\purge.bat
代码如下:

@echo off

set MC=unset
if "%PROCESSOR%" == "INTEL_64" set MC=ia64_nt
if "%PROCESSOR%" == "INTEL_486" set MC=i486_nt
if "%PROCESSOR_ARCHITECTURE%" == "IA64" set MC=ia64_nt
if "%PROCESSOR_ARCHITECTURE%" == "AMD64" set MC=x86e_win64
if "%PROCESSOR_ARCHITECTURE%" == "x86" set MC=i486_nt
if not "%MC%" == "unset" goto mc_done
echo ERROR Cannot detect what machine type you have.
echo Please make one of the following settings:
echo.
echo set PROCESSOR=INTEL_486     - For Windows NT Intel based machines.
echo.
echo set PROCESSOR=INTEL_64      - For Windows Intel Itanium based machines.
echo.
echo set PROCESSOR_ARCHITECTURE=AMD64 - For Windows AMD 64 based machines.
echo.
exit
:mc_done

set PRO_MACHINE_TYPE=%MC%

if "%PROOBJ_START_DIRECTORY%" == "" set PRO_DIRECTORY=
if NOT "%PRO_DIRECTORY%" == "" "%PRO_DIRECTORY%\bin\%MC%_ptc_setvars" %0 "purge" bat
if "%PRO_DIRECTORY%" == "" %MC%_ptc_setvars %0 "purge" bat
call ptc_setvars.bat
del  ptc_setvars.bat

set start_cmd=start ""

set PRO_DIRECTORY=%PRODIR%
if NOT "%PTCPATH%" == "" goto ptcpathset

set path=%PRO_DIRECTORY%\bin;%path%

set PTCPATH=true
:ptcpathset


"%PRODIR%\%MC%\obj\purge.exe" %1 %2 %3 %4 %5
:ptc_end
exit /B %ERRORLEVEL%

2006-12-19 07:41
查看资料  发短消息 网志   编辑帖子  回复  引用回复
namejm
荣誉版主

batch fan


积分 5226
发帖 1737
注册 2006-3-10
来自 成都
状态 离线
『第 7 楼』:  

  以下代码会显示D盘中要删除的旧文件。因为要搜索整个分区,速度将会较慢,请耐心等待;若显示的结果正确,请把 echo 语句换成 del 语句即可;若要删除其他分区里的旧文件,请把  d:\aa.prt.* 中的 d 换成其他字母。
@echo off
cd.>tmp1.txt
for /f "delims=" %%i in ('dir /a-d /b /s d:\aa.prt.*') do echo %%~xi "%%i">>tmp1.txt
sort /r<tmp1.txt>tmp2.txt
echo 要删除的旧文件有:
for /f "skip=1 tokens=1*" %%i in (tmp2.txt) do echo %%j
del /q tmp1.txt tmp2.txt
pause




尺有所短,寸有所长,学好CMD没商量。
考虑问题复杂化,解决问题简洁化。
2006-12-19 10:26
查看资料  发短消息 网志   编辑帖子  回复  引用回复
caiwei5566
初级用户





积分 48
发帖 19
注册 2006-11-27
状态 离线
『第 8 楼』:  

不行啊老大,其中
for /f "delims=" %%i in ('dir /a-d /b /s d:\aa.prt.*') do echo %%~xi "%%i">>tmp1.txt
文件名应为*.prt.*,但是更换后依然无效,郁闷中。。。

2006-12-19 11:50
查看资料  发短消息 网志   编辑帖子  回复  引用回复
namejm
荣誉版主

batch fan


积分 5226
发帖 1737
注册 2006-3-10
来自 成都
状态 离线
『第 9 楼』:  

  呵呵,我还从来没见过后缀名为 1、2、3 之类纯数字的,你没把后缀名看错吧?



尺有所短,寸有所长,学好CMD没商量。
考虑问题复杂化,解决问题简洁化。
2006-12-19 11:53
查看资料  发短消息 网志   编辑帖子  回复  引用回复
caiwei5566
初级用户





积分 48
发帖 19
注册 2006-11-27
状态 离线
『第 10 楼』:  

老大开玩笑吧,我天天用,难不成耍着玩啊。。。

驱动器 D 中的卷是 设计资料
卷的序列号是 1CB3-0074

D:\proe 的目录

shaozi.prt.12        xuezi.prt.2          power_varsec.prt.3
dian.prt.4           fff1.prt.1           z01.prt.1
fff2.prt.1           fff3.prt.1           rose.prt
modem.prt.2          tosater.prt.2        x-sports.prt.1
ear.prt.8            prt0003.prt.1        denglong2.prt.2
2a.prt.1             yangou.prt.8         fuliziyhg03.prt.7
luowen.prt.1         sanjiao.prt.18      
              20 个文件     14,402,605 字节
               0 个目录  1,167,491,072 可用字节

2006-12-19 12:14
查看资料  发短消息 网志   编辑帖子  回复  引用回复
namejm
荣誉版主

batch fan


积分 5226
发帖 1737
注册 2006-3-10
来自 成都
状态 离线
『第 11 楼』:  

  看来还真有这样的后缀啊,我孤陋寡闻了。

  我说过,搜索整个分区的速度比较慢,可能是你还没等到程序执行完毕就把它终止了,导致你认为找不到。你能把执行的最后结果抓个图发出来吗?



尺有所短,寸有所长,学好CMD没商量。
考虑问题复杂化,解决问题简洁化。
2006-12-19 12:24
查看资料  发短消息 网志   编辑帖子  回复  引用回复
caiwei5566
初级用户





积分 48
发帖 19
注册 2006-11-27
状态 离线
『第 12 楼』:  

把搜索文件替换为*.prt.*后,搜索后运行如下内容,即退出执行。。。


要删除的旧文件有:
"e:\Program Files\Premiere 6.5 中文绿色版\Presets\Templates\Upper Thirds\Upper Third 1006.prtl"
"e:\Program Files\Premiere 6.5 中文绿色版\Presets\Templates\Upper Thirds\Upper Third 1004.prtl"
"e:\Program Files\Premiere 6.5 中文绿色版\Presets\Templates\Upper Thirds\Upper Third 1002.prtl"
"e:\Program Files\Premiere 6.5 中文绿色版\Presets\Templates\Travel\World Travel\wt title.prtl"
"e:\Program Files\Premiere 6.5 中文绿色版\Presets\Templates\Travel\World Travel\wt lower3rd.prtl"
"e:\Program Files\Premiere 6.5 中文绿色版\Presets\Templates\Travel\World Travel\wt frame.prtl"
"e:\Program Files\Premiere 6.5 中文绿色版\Presets\Templates\Travel\Tropical\trp title.prtl"
"e:\Program Files\Premiere 6.5 中文绿色版\Presets\Templates\Travel\Tropical\trp lower3rd.prtl"
"e:\Program Files\Premiere 6.5 中文绿色版\Presets\Templates\Travel\Tropical\trp frame.prtl"
"e:\Program Files\Premiere 6.5 中文绿色版\Presets\Templates\Travel\Trek\trk title.prtl"
"e:\Program Files\Premiere 6.5 中文绿色版\Presets\Templates\Travel\Trek\trk lower3rd.prtl"
"e:\Program Files\Premiere 6.5 中文绿色版\Presets\Templates\Travel\Trek\trk list.prtl"
"e:\Program Files\Premiere 6.5 中文绿色版\Presets\Templates\Travel\Trek\trk frame.prtl"
"e:\Program Files\Premiere 6.5 中文绿色版\Presets\Templates\Travel\Road Trip\rt title.prtl"
"e:\Program Files\Premiere 6.5 中文绿色版\Presets\Templates\Travel\Road Trip\rt lower3rd.prtl"
"e:\Program Files\Premiere 6.5 中文绿色版\Presets\Templates\Travel\Road Trip\rt list.prtl"
"e:\Program Files\Premiere 6.5 中文绿色版\Presets\Templates\Travel\Road Trip\rt frame.prtl"
"e:\Program Files\Premiere 6.5 中文绿色版\Presets\Templates\Travel\Asian Influence\ai title.prtl"
"e:\Program Files\Premiere 6.5 中文绿色版\Presets\Templates\Travel\Asian Influence\ai list.prtl"
"e:\Program Files\Premiere 6.5 中文绿色版\Presets\Templates\Title Centered\Title Centered 1007.prtl"
"e:\Program Files\Premiere 6.5 中文绿色版\Presets\Templates\Title Centered\Title Centered 1002.prtl"
"e:\Program Files\Premiere 6.5 中文绿色版\Presets\Templates\Title Centered\Title Centered 1001.prtl"
"e:\Program Files\Premiere 6.5 中文绿色版\Presets\Templates\Sports\Winter Sports\wntr title.prtl"
"e:\Program Files\Premiere 6.5 中文绿色版\Presets\Templates\Sports\Winter Sports\wntr lower3rd.prtl"
"e:\Program Files\Premiere 6.5 中文绿色版\Presets\Templates\Sports\Winter Sports\wntr list.prtl"
"e:\Program Files\Premiere 6.5 中文绿色版\Presets\Templates\Sports\Winter Sports\wntr frame.prtl"
"e:\Program Files\Premiere 6.5 中文绿色版\Presets\Templates\Sports\Water Sports\ws title.prtl"
"e:\Program Files\Premiere 6.5 中文绿色版\Presets\Templates\Sports\Water Sports\ws lower3rd.prtl"
"e:\Program Files\Premiere 6.5 中文绿色版\Presets\Templates\Sports\Soccer\scr title.prtl"
"e:\Program Files\Premiere 6.5 中文绿色版\Presets\Templates\Sports\Soccer\scr lower3rd.prtl"
"e:\Program Files\Premiere 6.5 中文绿色版\Presets\Templates\Sports\Soccer\scr list.prtl"
"e:\Program Files\emx4.1\in\parts\slider\omni\inch\set_3\slider_plate.prt"
"e:\Program Files\emx4.1\in\parts\slider\omni\inch\set_3\locking_heel.prt"
"e:\Program Files\emx4.1\in\parts\slider\omni\inch\set_3\lgib_right.prt"
"e:\Program Files\emx4.1\in\parts\slider\omni\inch\set_3\lgib_left.prt"
"e:\Program Files\emx4.1\in\parts\slider\omni\inch\set_3\cam.prt"
"e:\Program Files\emx4.1\in\parts\slider\omni\inch\set_3\anglepin.prt"
"e:\Program Files\emx4.1\in\parts\slider\omni\inch\set_22\slider_plate.prt"
"e:\Program Files\emx4.1\in\parts\slider\omni\inch\set_22\locking_heel.prt"
"e:\Program Files\emx4.1\in\parts\slider\omni\inch\set_22\lgib_right.prt"
"e:\Program Files\emx4.1\in\parts\slider\omni\inch\set_22\lgib_left.prt"
"e:\Program Files\emx4.1\in\parts\slider\omni\inch\set_22\cam.prt"
"e:\Program Files\emx4.1\in\parts\slider\omni\inch\set_22\anglepin.prt"
"e:\Program Files\emx4.1\in\parts\slider\omni\inch\set_21\slider_plate.prt"
"e:\Program Files\emx4.1\in\parts\slider\omni\inch\set_21\locking_heel.prt"
"e:\Program Files\emx4.1\in\parts\slider\omni\inch\set_21\lgib_right.prt"
"e:\Program Files\emx4.1\in\parts\slider\omni\inch\set_21\lgib_left.prt"
"e:\Program Files\emx4.1\in\parts\slider\omni\inch\set_21\cam.prt"
"e:\Program Files\emx4.1\in\parts\slider\omni\inch\set_21\anglepin.prt"
"e:\Program Files\emx4.1\in\parts\slider\omni\inch\set_20\slider_plate.prt"
"e:\Program Files\emx4.1\component_library\progressive\Ext_Mount_Connectors\plug_in.prt"
"e:\Program Files\emx4.1\component_library\progressive\Ext_Mount_Connectors\plug.prt"
"e:\Program Files\emx4.1\component_library\progressive\Ext_Mount_Connectors\ext_mount_connector_in.prt"
"e:\Program Files\emx4.1\component_library\progressive\Ext_Mount_Connectors\ext_mount_connector.prt"
"e:\Program Files\emx4.1\component_library\progressive\EjectionActuation\pin_plate_couplings.prt"
"e:\Program Files\emx4.1\component_library\progressive\EjectionActuation\key.prt"
"e:\Program Files\emx4.1\component_library\progressive\EjectionActuation\cylinder.prt"
"e:\Program Files\emx4.1\component_library\progressive\Dual_Eject_Switch\plug.prt"
"e:\Program Files\emx4.1\component_library\progressive\Dual_Eject_Switch\dual_eject_switch.prt"
"e:\Program Files\emx4.1\component_library\progressive\Dual_Eject_Switch\contact.prt"
"e:\Program Files\emx4.1\component_library\progressive\Date_Stamps\replacement_plug.prt"
"e:\Program Files\emx4.1\component_library\progressive\Date_Stamps\recycle_insert.prt"
"e:\Program Files\emx4.1\component_library\progressive\Date_Stamps\micro_daters.prt"
"e:\Program Files\emx4.1\component_library\progressive\Date_Stamps\date_ring_compact.prt"
"e:\Program Files\emx4.1\component_library\progressive\Date_Stamps\date_ring_20.prt"
"e:\Program Files\emx4.1\component_library\progressive\Date_Stamps\date_plug_compact.prt"
"e:\Program Files\emx4.1\component_library\progressive\Date_Stamps\date_plug_20.prt"
"e:\Program Files\emx4.1\component_library\progressive\Counters\counter_line.prt"
"e:\Program Files\emx4.1\component_library\progressive\Counters\counter_internal.prt"
"e:\Program Files\emx4.1\component_library\progressive\Counters\counter_ex_block.prt"
"e:\Program Files\emx4.1\component_library\progressive\Counters\counter_ex.prt"
"e:\Program Files\emx4.1\component_library\progressive\CamAction_Switch\recessed_connector_ca100.prt"
"e:\Program Files\emx4.1\component_library\progressive\CamAction_Switch\plug_contacts_car100.prt"
"e:\Program Files\emx4.1\component_library\progressive\CamAction_Switch\plug_ca100.prt"
"e:\Program Files\emx4.1\component_library\progressive\CamAction_Switch\plug_base_car100.prt"
"e:\Program Files\emx4.1\component_library\progressive\CamAction_Switch\plug_attachment_car100.prt"
"e:\Program Files\emx4.1\component_library\progressive\CamAction_Switch\contact_car100.prt"
"e:\Program Files\emx4.1\component_library\progressive\CamAction_Switch\contact_ca100.prt"
"e:\Program Files\emx4.1\component_library\progressive\CamAction_Switch\camaction_switch_car100.prt"
"e:\Program Files\emx4.1\component_library\progressive\CamAction_Switch\camaction_switch_ca100.prt"
"e:\Program Files\emx4.1\component_library\progressive\Button_Style_Transducer\plug_button_style.prt"
"e:\Program Files\emx4.1\component_library\progressive\Button_Style_Transducer\button_style_transducer.prt"
"e:\Program Files\emx4.1\component_library\progressive\Bcp_Mount\plug.prt"
"e:\Program Files\emx4.1\component_library\progressive\Bcp_Mount\contact.prt"
"e:\Program Files\emx4.1\component_library\progressive\Bcp_Mount\bcp_mount.prt"
"e:\Program Files\emx4.1\component_library\progressive\Additional_Cooling\threadless_plug.prt"
"e:\Program Files\emx4.1\component_library\progressive\Additional_Cooling\tees.prt"
"e:\Program Files\emx4.1\component_library\progressive\Additional_Cooling\street_elbow_90.prt"
"e:\Program Files\emx4.1\component_library\progressive\Additional_Cooling\street_elbow_45.prt"
"e:\Program Files\emx4.1\component_library\progressive\Additional_Cooling\reducing_bushings.prt"
"e:\Program Files\emx4.1\component_library\progressive\Additional_Cooling\male_hose_barbs.prt"
"e:\Program Files\emx4.1\component_library\progressive\Additional_Cooling\hose_splicers.prt"
"e:\Program Files\emx4.1\component_library\progressive\Additional_Cooling\hkc_tube.prt"
"e:\Program Files\emx4.1\component_library\progressive\Additional_Cooling\hkc_nipple.prt"
"e:\Program Files\emx4.1\component_library\progressive\Additional_Cooling\hkc_head.prt"
"e:\Program Files\emx4.1\component_library\progressive\Additional_Cooling\high_flow_tube.prt"
"e:\Program Files\emx4.1\component_library\progressive\Additional_Cooling\hfc_tube.prt"
"e:\Program Files\emx4.1\component_library\progressive\Additional_Cooling\hfc_nipple.prt"
"e:\Program Files\emx4.1\component_library\progressive\Additional_Cooling\hfc_head.prt"
"e:\Program Files\emx4.1\component_library\progressive\Additional_Cooling\hex_extension_elbows.prt"
"e:\Program Files\emx4.1\component_library\progressive\Additional_Cooling\hex_elbows.prt"
"e:\Program Files\emx4.1\component_library\progressive\Additional_Cooling\hex_elbow.prt"
"e:\Program Files\emx4.1\component_library\progressive\Additional_Cooling\female_hose_barbs.prt"
"e:\Program Files\emx4.1\component_library\progressive\Additional_Cooling\extension_elbows.prt"
"e:\Program Files\emx4.1\component_library\progressive\Additional_Cooling\elbow_90.prt"
"e:\Program Files\emx4.1\component_library\progressive\Additional_Cooling\couplings.prt"
"e:\Program Files\emx4.1\component_library\progressive\Additional_Cooling\cc_tube.prt"
"e:\Program Files\emx4.1\component_library\progressive\Additional_Cooling\cc_nipple.prt"
"e:\Program Files\emx4.1\component_library\progressive\Additional_Cooling\cc_head.prt"
"e:\Program Files\emx4.1\component_library\progressive\Additional_Cooling\c_tube.prt"
"e:\Program Files\emx4.1\component_library\progressive\Additional_Cooling\c_nipple.prt"
"e:\Program Files\emx4.1\component_library\progressive\Additional_Cooling\c_head.prt"
"e:\Program Files\emx4.1\component_library\progressive\Additional_Cooling\brass_tube.prt"
"e:\Program Files\emx4.1\component_library\omni\runner_sucker.prt"
"e:\Program Files\emx4.1\component_library\omni\round_top_cavity.prt"
"e:\Program Files\emx4.1\component_library\omni\round_bottom_cavity.prt"
"e:\Program Files\emx4.1\component_library\modular-mold\two_orings.prt"
"e:\Program Files\emx4.1\component_library\modular-mold\top_lock_male.prt"
"e:\Program Files\emx4.1\component_library\modular-mold\top_lock_fem.prt"
"e:\Program Files\emx4.1\component_library\modular-mold\support_pillar.prt"
"e:\Program Files\emx4.1\component_library\modular-mold\sleeve_support_pillar.prt"
"e:\Program Files\emx4.1\component_library\modular-mold\rmi8000_multipos.prt"
"e:\Program Files\emx4.1\component_library\modular-mold\rmi8000.prt"
"e:\Program Files\emx4.1\component_library\modular-mold\rmi6000_multipos.prt"
"e:\Program Files\emx4.1\component_library\modular-mold\rmi6000.prt"
"e:\Program Files\emx4.1\component_library\modular-mold\rmi4000.prt"
"e:\Program Files\emx4.1\component_library\modular-mold\rmi3000.prt"
"e:\Program Files\emx4.1\component_library\modular-mold\rmc0104.prt"
"e:\Program Files\emx4.1\component_library\modular-mold\rmc0103.prt"
"e:\Program Files\emx4.1\component_library\modular-mold\return_pin_extension.prt"
"e:\Program Files\emx4.1\component_library\modular-mold\retainer.prt"
"e:\Program Files\emx4.1\component_library\modular-mold\baffle.prt"
"e:\Program Files\emx4.1\component_library\guides\shc_screw.prt"
"e:\Program Files\emx4.1\component_library\guides\puller_bolt.prt"
"e:\Program Files\emx4.1\component_library\guides\lp_a.prt"
"e:\Program Files\emx4.1\component_library\guides\egpb_c.prt"
"e:\Program Files\emx4.1\component_library\guides\egp_d.prt"
"e:\Program Files\emx4.1\component_library\guides\egp_c.prt"
"e:\Program Files\emx4.1\component_library\guides\collar.prt"
"e:\Program Files\emx4.1\component_library\equipment_korea\sprue_bush_b.prt"
"e:\Program Files\emx4.1\component_library\equipment_korea\sprue_bush_a.prt"
"e:\Program Files\emx4.1\component_library\equipment_korea\spb_3pl_type.prt"
"e:\Program Files\emx4.1\component_library\equipment_korea\spb_2pl_type.prt"
"e:\Program Files\emx4.1\component_library\equipment_korea\rlr.prt"
"e:\Program Files\emx4.1\component_library\equipment_korea\locket_ring_e.prt"
"e:\Program Files\emx4.1\component_library\equipment_korea\locket_ring_cd.prt"
"e:\Program Files\emx4.1\component_library\equipment_korea\locket_ring_abc.prt"
"e:\Program Files\emx4.1\component_library\equipment_korea\locate_ring_b.prt"
"e:\Program Files\emx4.1\component_library\equipment_korea\locate_ring_a.prt"
"e:\Program Files\emx4.1\component_library\equipment\puller_bolt.prt"
"e:\Program Files\emx4.1\component_library\ejection\ejector_support.prt"
"e:\Program Files\emx4.1\component_library\cooling\waterline1.prt"
"e:\Program Files\emx4.1\component_library\cooling\water_plug_cu.prt"
"e:\Program Files\emx4.1\component_library\cooling\water_baffle_b.prt"
"e:\Program Files\emx4.1\component_library\cooling\water_baffle_a.prt"
"e:\Program Files\emx4.1\component_library\cooling\staeubli_rpl.prt"
"e:\Program Files\emx4.1\component_library\cooling\seal_disc.prt"
"e:\aa.prt.3"
"e:\Program Files\proe2001\jlink\jlink_appls\jlink_elev\models\bracket_top.prt.2"
"e:\Program Files\emx4.1\START_DIR\prt0001.prt.1"
"e:\Program Files\emx4.1\START_DIR\new_b_plate1.prt.1"
"e:\Program Files\emx4.1\START_DIR\new_a_plate1.prt.1"
"e:\aa.prt.1"
请按任意键继续. . .

2006-12-19 12:47
查看资料  发短消息 网志   编辑帖子  回复  引用回复
namejm
荣誉版主

batch fan


积分 5226
发帖 1737
注册 2006-3-10
来自 成都
状态 离线
『第 13 楼』:  

  原来文件名是这样的啊。把7F的代码改为下面的代码,因为 sort 的原因,只对后缀名在10以内的有效,请再次测试:
@echo off
cd.>tmp1.txt
cd.>tmp2.txt
for /f "delims=" %%i in ('dir /a-d /b /s d:\*.prt.*^|findstr /i "\.prt\.[0-9][0-9]*$"') do echo %%~xi "%%i">>tmp1.txt
sort /r<tmp1.txt>tmp2.txt
echo 要删除的旧文件有:
for /f "skip=1 tokens=1*" %%i in (tmp2.txt) do echo %%j
del /q tmp1.txt tmp2.txt
pause




尺有所短,寸有所长,学好CMD没商量。
考虑问题复杂化,解决问题简洁化。
2006-12-19 13:18
查看资料  发短消息 网志   编辑帖子  回复  引用回复
ieutk
初级用户




积分 107
发帖 48
注册 2006-11-30
状态 离线
『第 14 楼』:  

LZ你看看,这个是我向公司搞产品开发的同事要来的一个BAT,不过我们用的是PROE野火版2.0,不知道对于你的3。0有没有用!
@echo off
cls
title Purge Subs


if !%1==! goto nopath
if not exist %1*.* goto badpath

:start
  title Purge Subs from %1
  call :subpurge %1
  FOR /D /R %%a IN (*.*) do call :subpurge "%%a"
  goto complete

:subpurge
  echo Purging, %1
  cd "%1"
  call purge.bat
  goto :EOF

:nopath
  echo.
  echo ERROR - No path provided....
  echo.
  echo You must provide a path when calling %0
  goto complete

:badpath
  echo.
  echo ERROR - "%1" is not a valid path....
  echo.
  echo You must provide a valid path when calling %0
  goto complete

:complete
  echo.
  pause
  exit
下面是PurgeProSubs.INF文件内容:
;
; Purge Pro/E Subs from Explorer
;

[version]
signature="$CHICAGO$"

[PurgeProSubsInstall]
CopyFiles = PurgeProSubs.Files.Inf
AddReg    = PurgeProSubs.Reg

[DefaultInstall]
CopyFiles = PurgeProSubs.Files.Inf
AddReg    = PurgeProSubs.Reg

[DefaultInstall.ntx86]
CopyFiles = PurgeProSubs.Files.Inf
AddReg    = PurgeProSubs.Reg.NT

[DefaultUnInstall]
DelFiles  = PurgeProSubs.Files.Inf
DelReg    = PurgeProSubs.Reg

[DefaultUnInstall.ntx86]
DelFiles  = PurgeProSubs.Files.Inf
DelReg    = PurgeProSubs.Reg.NT

[SourceDisksNames]
55="Purge Pro/E Files","",1

[SourceDisksFiles]
PurgeProSubs.INF=55

[DestinationDirs]
PurgeProSubs.Files.Inf = 17

[PurgeProSubs.Files.Inf]
PurgeProSubs.INF

; This section is for Win95 (untested on Win95)
[PurgeProSubs.Reg]
HKLM,%UDHERE%
HKLM,%UDHERE%,DisplayName,,"%PurgeProSubsName%"
HKLM,%UDHERE%,UninstallString,,"%10%\rundll.exe setupx.dll,InstallHinfSection DefaultUninstall 132 %17%\PurgeProSubs.inf"
HKCR,Directory\Shell\PurgeProSubs,,,"%PurgeProSubsAccel%"
;-----------------This is the line that calls the purge.bat file-----\
HKCR,Directory\Shell\PurgeProSubs\command,,,"%10%\command.exe /c purgesubs.bat ""%1""

; This section is for WinNT 4.0
[PurgeProSubs.Reg.NT]
HKLM,%UDHERE%
HKLM,%UDHERE%,DisplayName,,"%PurgeProSubsName%"
HKLM,%UDHERE%,UninstallString,,"rundll32.exe syssetup.dll,SetupInfObjectInstallAction DefaultUninstall 132 %17%\PurgeProSubs.inf"
HKCR,Directory\Shell\PurgeProSubs,,,"%PurgeProSubsAccel%"
;-----------------This is the line that calls the purge.bat file-----\
HKCR,Directory\Shell\PurgeProSubs\command,,,"%11%\cmd.exe /c purgesubs.bat ""%1""


[Strings]
; This is the name which shows up in the "Add/Remove Programs" list
PurgeProSubsName="Pro/E Purge Subs command (Remove Only)"
; This is the menu entry that shows up when you right click on a folder in explorer
; The "&" caues the next character to be (underlined) hot key
PurgeProSubsAccel="Pro/E Purge &Subs"
UDHERE="Software\Microsoft\Windows\CurrentVersion\Uninstall\PurgeProSubs"
把它COPY到你电脑里,保存为PurgeProSubs.INF,然后在那个文件点右键,选择安装,再把上面的批代码保存为PurgeSubs.bat,把它COPY到PROE安装目录下的BIN子目录里面去就可以了!

然后回到proe2001这个目录上面,在proe2001上点右键,右键菜单上就会多出一个pro/E Purge Subs选项!

[ Last edited by ieutk on 2007-6-19 at 10:38 PM ]



她希望我把粪土变黄金,我希望她视黄金如粪土!
2007-6-19 22:23
查看资料  发送邮件  发短消息 网志   编辑帖子  回复  引用回复
oicu
新手上路





积分 10
发帖 5
注册 2007-12-11
状态 离线
『第 15 楼』:  

虽然是去年的帖子,还是要re一个。。。来支持jm的版面了。

把下面两行文字复制到记事本并另存为 Purge_ProE.bat 文件:

::Code by oicu#lsxk.org 2007/12/10, for Windows 2000/XP
@for /r %%i in (.) do @cd /d "%%i" & call purge.bat

使用条件及方法:
安装有 ProE 2001/Wildfire2.0 的 Windows 2000/XP,野火3.0及
4.0没有测试,应该同样适用。该批处理实际是调用 ProE 自带的
Purge 文件。

2007-12-11 02:10
查看资料  发短消息 网志   编辑帖子  回复  引用回复
« [1] [2] »
请注意:您目前尚未注册或登录,请您注册登录以使用论坛的各项功能,例如发表和回复帖子等。


可打印版本 | 推荐给朋友 | 订阅主题 | 收藏主题



论坛跳转: