cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

How to remove backup files suffix?

SOLVED
Highlighted
Newbie

How to remove backup files suffix?

Hi

I am using Creo 2.0 . I have created a mapkey, that saves the current file and deletes the old versions of the file. This is done by File>save, File>Manage File >Delete Old Versions.

Say the name of the file is "car.asm". When using the mapkey the new file will be named "car.asm.2".

Is there a way to get rid of the suffix number in the end of the filename?

Frederik

Tags (3)
1 ACCEPTED SOLUTION

Accepted Solutions

Re: How to remove backup files suffix?

Hello Frederik Hansen

there is no simply way to remove "file version".

Personaly don´t use Creo function like you have described.

Instead of this l´m using Spurge utility. See folowing topic Re: Spekan Purge Tool

There is possibility to rename last version to no:1.

purge.gif

But the number of version will be always included in file name.

It´s possible to hide file extensions somwhere in Windows (it´s Windows settings --- NOT CREO settings)

Hope it can helps

Regards Milan

View solution in original post

9 REPLIES 9

Re: How to remove backup files suffix?

Hello Frederik Hansen

there is no simply way to remove "file version".

Personaly don´t use Creo function like you have described.

Instead of this l´m using Spurge utility. See folowing topic Re: Spekan Purge Tool

There is possibility to rename last version to no:1.

purge.gif

But the number of version will be always included in file name.

It´s possible to hide file extensions somwhere in Windows (it´s Windows settings --- NOT CREO settings)

Hope it can helps

Regards Milan

View solution in original post

Re: How to remove backup files suffix?

Thanks for the help, do you know with if there is way to rename last version to no. 1, without using the Spekan purge tool?

Re: How to remove backup files suffix?

Why does rename action had to be called from within Pro/E session? For all practical reasons the file index is hidden from an end user by Pro/E's 'File Open' dialog GUI. On the other hand, the renaming of a file from the OS is a trivial matter...

Re: How to remove backup files suffix?

l´ve never thought about other way how to rename version no.

Because sPurge has batch capability and in my opinion it´s absolutly reliable software.

Don´t rename files directly in Windows!  Rename in Windows = lose data.

Have you tested sPurge?

Note:

ln generall l don´t care about version no. "Has no function", if you don´t use Windchill . Only moment, when l discovered some problems with version number, was during first (basic) data import to new Windchill server (due data duplication).

Re: How to remove backup files suffix?

Hello all,

Unless I'm totally clueless the memory dump of sPurge.exe looks like a typical 32 bit Windows operating system PE file fully dependent on OS utilities for its functioning. There is no magic to sPurge.exe, it is just a UI wrapper around core Windows filesystem functionality ( very nicely done by the way).

>dumpbin /all spurge.exe

Microsoft (R) COFF/PE Dumper Version 14.00.23824.1
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file sPurge.exe

PE signature found

File Type: EXECUTABLE IMAGE

FILE HEADER VALUES
             14C machine (x86)
               4 number of sections
        3F584C6A time date stamp Fri Sep  5 03:42:18 2003
               0 file pointer to symbol table
               0 number of symbols
              E0 size of optional header
             10F characteristics
                   Relocations stripped
                   Executable
                   Line numbers stripped
                   Symbols stripped
                   32 bit word machine

OPTIONAL HEADER VALUES
             10B magic # (PE32)
            6.00 linker version
           32000 size of code
          14B000 size of initialized data
               0 size of uninitialized data
           184CE entry point (004184CE)
            1000 base of code
           33000 base of data
          400000 image base (00400000 to 0057DFFF)
            1000 section alignment
            1000 file alignment
            4.00 operating system version
            0.00 image version
            4.00 subsystem version
               0 Win32 version
          17E000 size of image
            1000 size of headers
               0 checksum
               2 subsystem (Windows GUI)
               0 DLL characteristics
          100000 size of stack reserve
            1000 size of stack commit
          100000 size of heap reserve
            1000 size of heap commit
               0 loader flags
              10 number of directories
               0 [       0] RVA [size] of Export Directory
           3DC70 [     118] RVA [size] of Import Directory
           47000 [  136FB0] RVA [size] of Resource Directory
               0 [       0] RVA [size] of Exception Directory
               0 [       0] RVA [size] of Certificates Directory
               0 [       0] RVA [size] of Base Relocation Directory
               0 [       0] RVA [size] of Debug Directory
               0 [       0] RVA [size] of Architecture Directory
               0 [       0] RVA [size] of Global Pointer Directory
               0 [       0] RVA [size] of Thread Storage Directory
               0 [       0] RVA [size] of Load Configuration Directory
               0 [       0] RVA [size] of Bound Import Directory
           33000 [     578] RVA [size] of Import Address Table Directory
               0 [       0] RVA [size] of Delay Import Directory
               0 [       0] RVA [size] of COM Descriptor Directory
               0 [       0] RVA [size] of Reserved Directory


SECTION HEADER #1
   .text name
   3164B virtual size
    1000 virtual address (00401000 to 0043264A)
   32000 size of raw data
    1000 file pointer to raw data (00001000 to 00032FFF)
       0 file pointer to relocation table
       0 file pointer to line numbers
       0 number of relocations
       0 number of line numbers
60000020 flags
         Code
         Execute Read

RAW DATA #1
  00401000: 56 8B F1 57 8B 7C 24 0C 8D 46 5C 50 68 10 04 00  V.±W.|$..F\Ph...
  00401010: 00 57 E8 F2 9E 02 00 8D 8E 98 00 00 00 51 68 00  .WΦ≥.........Qh.
 

sPurge_dependencies.PNG

Re: How to remove backup files suffix?

l´m not a programmer. Don´t know how exactly sPurge works. l´m only user of this software.

Re: How to remove backup files suffix?

Hi,

just a little explanation...

Imagine that part name is mypart.prt.123

  • in Windows Explorer user can change/remove numerical extension and get names such as mypart.prt.1 or mypart.prt
  • in Windows Explorer user must not change file name to get name such as mypart2.prt - this kind of rename must be done within Creo/ProE session, because part name info is saved inside the file, too

MH


Martin Hanák

Re: How to remove backup files suffix?

The renaming does not necessarily have to be done in Creo. Although I can see that Milan does not recommend renaming outside Creo. The reason why I want to remove the extension number is when sharing the file with others, the extension number is not of interest. Therefor I would rather get rid of it. So hiding the extension file number in my windows settings, does not quite do the work.

Re: How to remove backup files suffix?

Hi all,

Frederik, here is what you could do : follow PTC CS151240 'Mapkey with OS Script'

mapkey_system_window-1.pngmapkey_system_window-2.png

and for a batch file this is command to use:

FOR /F "usebackq  tokens=1-3 delims=." %i IN (`dir /b *.prt.*`) DO move %i.%j.%k %i.%j.1

FOR /F "usebackq  tokens=1-3 delims=." %i IN (`dir /b *.asm.*`) DO move %i.%j.%k %i.%j.1

FOR /F "usebackq  tokens=1-3 delims=." %i IN (`dir /b *.drw.*`) DO move %i.%j.%k %i.%j.1

You'll need to escape '%' character in batch file though...

HIH.

Feliks.

Announcements