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-06-22 17:14
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Help: How to delete the old version files of Pro/ENGINEER in the hard drive! View 8,240 Replies 15
Original Poster Posted 2006-12-18 09:35 ·  中国 广东 东莞 电信
初级用户
Credits 48
Posts 19
Joined 2006-11-27 05:07
19-year member
UID 71852
Gender Male
Status Offline
I am using ProE for 3D design. Each time ProE saves, a new version file is generated. For example, the old version is aa.prt.1 and the new version is aa.prt.2, and so on. Although the software provides pruge.bat to delete the old version files in the working directory, after a long time, there are old version files in many folders. I hope to be provided with a quick method to clean up the old version files in a certain disk at one time.
Floor 2 Posted 2006-12-18 10:02 ·  中国 广东 电信
荣誉版主
★★★★
batch fan
Credits 5,226
Posts 1,737
Joined 2006-03-10 00:38
20-year member
UID 51697
From 成都
Status Offline
The old files you mentioned, do they refer to all files like aa.prt.XX and so on? After reading your description, I'm not very sure what exactly the old files look like. Also, where are these old files stored?
尺有所短,寸有所长,学好CMD没商量。
考虑问题复杂化,解决问题简洁化。
Floor 3 Posted 2006-12-18 12:25 ·  中国 广东 东莞 电信
初级用户
Credits 48
Posts 19
Joined 2006-11-27 05:07
19-year member
UID 71852
Gender Male
Status Offline
Yeah, the new version of the file is just adding 1 after aa.prt.x. In short, the suffix of the new version of the file must be larger than that of the old version. For example, the old version might be aa.prt.2, while the new version is aa.prt.7 or larger. The files are placed in a messy way, possibly in many directories within one disk. The key is to clear all these old versions at one time... This is very practical in data organization...
Floor 4 Posted 2006-12-18 12:42 ·  中国 广东 电信
荣誉版主
★★★★
batch fan
Credits 5,226
Posts 1,737
Joined 2006-03-10 00:38
20-year member
UID 51697
From 成都
Status Offline
That is to say, you need to search for files like aa.prt.number in a certain partition, right? And only keep the one with the largest number?
尺有所短,寸有所长,学好CMD没商量。
考虑问题复杂化,解决问题简洁化。
Floor 5 Posted 2006-12-18 13:00 ·  中国 广东 东莞 电信
初级用户
Credits 48
Posts 19
Joined 2006-11-27 05:07
19-year member
UID 71852
Gender Male
Status Offline
Simply put, it's like this. I'm a newbie, and I'm asking for experts' advice...
Floor 6 Posted 2006-12-19 07:41 ·  中国 广东 东莞 电信
初级用户
Credits 48
Posts 19
Joined 2006-11-27 05:07
19-year member
UID 71852
Gender Male
Status Offline
No, nobody knows? Is it difficult or too easy...

In fact, there are two relatively difficult places. One is that the directory where the file is located is not fixed, so it is necessary to search and then classify. The second is that the number of files in the old version is not fixed, there may be multiple or only one. For example, the new version is: filename.prt.7, while the old version may be: filename.prt.5, filename.prt.3, etc.

The following is attached the batch processing for clearing in the working directory that comes with the Pro/E program, but it can only clear one directory at a time, and cannot clear the entire disk.
The file is located at: E:\Program Files\proeWildfire 3.0\bin\purge.bat
The code is as follows:

@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%
Floor 7 Posted 2006-12-19 10:26 ·  中国 广东 电信
荣誉版主
★★★★
batch fan
Credits 5,226
Posts 1,737
Joined 2006-03-10 00:38
20-year member
UID 51697
From 成都
Status Offline
The following code will display the old files to be deleted in drive D. Since it needs to search the entire partition, the speed will be slow; please be patient. If the displayed result is correct, replace the echo statement with the del statement. If you want to delete old files in other partitions, replace the d in d:\aa.prt.* with another letter.

@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 The old files to be deleted are:
for /f "skip=1 tokens=1*" %%i in (tmp2.txt) do echo %%j
del /q tmp1.txt tmp2.txt
pause
尺有所短,寸有所长,学好CMD没商量。
考虑问题复杂化,解决问题简洁化。
Floor 8 Posted 2006-12-19 11:50 ·  中国 广东 东莞 电信
初级用户
Credits 48
Posts 19
Joined 2006-11-27 05:07
19-year member
UID 71852
Gender Male
Status Offline
No good, boss. Among them
for /f "delims=" %%i in ('dir /a-d /b /s d:\aa.prt.*') do echo %%~xi "%%i">>tmp1.txt
The file name should be *.prt.*, but it's still ineffective after replacement. I'm郁闷啊...
Floor 9 Posted 2006-12-19 11:53 ·  中国 广东 电信
荣誉版主
★★★★
batch fan
Credits 5,226
Posts 1,737
Joined 2006-03-10 00:38
20-year member
UID 51697
From 成都
Status Offline
Hehe, I've never seen a file with a suffix like 1, 2, 3 which is just a pure number. Did you misread the suffix?
尺有所短,寸有所长,学好CMD没商量。
考虑问题复杂化,解决问题简洁化。
Floor 10 Posted 2006-12-19 12:14 ·  中国 广东 东莞 电信
初级用户
Credits 48
Posts 19
Joined 2006-11-27 05:07
19-year member
UID 71852
Gender Male
Status Offline
Boss, are you kidding? I use it every day. Could it be for fun...

Volume in drive D is Design Data
Volume Serial Number is 1CB3-0074

Directory of 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 File(s) 14,402,605 bytes
0 Dir(s) 1,167,491,072 bytes free
Floor 11 Posted 2006-12-19 12:24 ·  中国 广东 电信
荣誉版主
★★★★
batch fan
Credits 5,226
Posts 1,737
Joined 2006-03-10 00:38
20-year member
UID 51697
From 成都
Status Offline
It seems there really are such suffixes. I'm ignorant.

I said that searching the entire partition is relatively slow. Maybe you terminated the program before it finished executing, leading you to think it couldn't be found. Can you capture a screenshot of the final result of the execution and post it?
尺有所短,寸有所长,学好CMD没商量。
考虑问题复杂化,解决问题简洁化。
Floor 12 Posted 2006-12-19 12:47 ·  中国 广东 东莞 电信
初级用户
Credits 48
Posts 19
Joined 2006-11-27 05:07
19-year member
UID 71852
Gender Male
Status Offline
After replacing the search file with *.prt.*, running the following content after the search will exit the execution...

The old files to be deleted are:
"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"
Press any key to continue...
Floor 13 Posted 2006-12-19 13:18 ·  中国 广东 电信
荣誉版主
★★★★
batch fan
Credits 5,226
Posts 1,737
Joined 2006-03-10 00:38
20-year member
UID 51697
From 成都
Status Offline
So the original file name is like this. Change the code of 7F to the following code. Because of the sort reason, it is only valid for suffixes with numbers within 10. Please test again:


@echo off
cd.>tmp1.txt
cd.>tmp2.txt
for /f "delims=" %%i in ('dir /a-d /b /s d:\*.prt.*^|findstr /i "\.prt\.*$"') do echo %%~xi "%%i">>tmp1.txt
sort /r<tmp1.txt>tmp2.txt
echo The old files to be deleted are:
for /f "skip=1 tokens=1*" %%i in (tmp2.txt) do echo %%j
del /q tmp1.txt tmp2.txt
pause
尺有所短,寸有所长,学好CMD没商量。
考虑问题复杂化,解决问题简洁化。
Floor 14 Posted 2007-06-19 22:23 ·  中国 广东 东莞 电信
初级用户
Credits 107
Posts 48
Joined 2006-11-30 12:06
19-year member
UID 72174
Gender Male
Status Offline
LZ, take a look. This is a BAT I got from my colleague who is developing products for the company. But we're using PROE Wildfire Edition 2.0. I don't know if it's useful for your 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


The following is the content of the PurgeProSubs.INF file:

;
; Purge Pro/E Subs from Explorer
;


signature="$CHICAGO$"


CopyFiles = PurgeProSubs.Files.Inf
AddReg = PurgeProSubs.Reg


CopyFiles = PurgeProSubs.Files.Inf
AddReg = PurgeProSubs.Reg


CopyFiles = PurgeProSubs.Files.Inf
AddReg = PurgeProSubs.Reg.NT


DelFiles = PurgeProSubs.Files.Inf
DelReg = PurgeProSubs.Reg


DelFiles = PurgeProSubs.Files.Inf
DelReg = PurgeProSubs.Reg.NT


55="Purge Pro/E Files","",1


PurgeProSubs.INF=55


PurgeProSubs.Files.Inf = 17


PurgeProSubs.INF

; This section is for Win95 (untested on Win95)

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

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""



; 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 it to your computer, save it as PurgeProSubs.INF, then right-click on that file and select Install. Then save the above batch code as PurgeSubs.bat, and copy it to the BIN subdirectory under the PROE installation directory. Then go back to the directory above proe2001, right-click on proe2001, and there will be an extra "pro/E Purge Subs" option in the right-click menu!

[ Last edited by ieutk on 2007-6-19 at 10:38 PM ]
她希望我把粪土变黄金,我希望她视黄金如粪土!
Floor 15 Posted 2007-12-11 02:10 ·  中国 广东 珠海 香洲区 电信
新手上路
Credits 10
Posts 5
Joined 2007-12-11 01:55
18-year member
UID 105281
Gender Male
Status Offline
Although it's a post from last year, still need to re! Come to support jm's board.

Copy the following two lines of text into Notepad and save as Purge_ProE.bat file:

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

Usage conditions and methods:
For Windows 2000/XP with ProE 2001/Wildfire2.0 installed, Wildfire 3.0 and 4.0 haven't been tested, should be applicable as well. This batch script actually calls the Purge file that comes with ProE.
Forum Jump: