I used task scheduler to convert mutiple ipt file to step files.
Unfortunately the files are now all called filename.ipt.step
can I rename each file to remove the '.ipt' so that the files are called filename.step? Perhaps using ilogic? or is there an easier way?
I could of course just go to Windows Explorer and manually rename each one, but that will be tedius beyond belief!
h, can someone please tell me the difference (if any) between step, stp, ste
Solved! Go to Solution.
Solved by Curtis_Waguespack. Go to Solution.
Hi Ben,
Here is a video showing how to do that just using Windows command prompt:
Thanks, I've had a look and i can see Bulkrenamer, Renamer.....guess any of them will do.
Thanks for pointing me in the right direction.
Hi ben.gee,
You can try this iLogic code. I use it for stripping out the file extensions after using the task scheduler.
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
Imports System.IO Imports System.Windows.Forms Sub Main Call FileType() Call StripText() Call GetFolderPath() Call RenameFiles() Try 'open the folder Process.Start(oPath) Catch End Try End Sub '[ shared variables Dim oPath As String Dim oFileExtension As String Dim oStripText As String '] Sub FileType() Dim oFileTypes = New String(){".stp", ".step" ,".igs" ,".iges" ,".sat"} oFileExtension = InputListBox("Select one:", oFileTypes, oFileTypes(0), _ "iLogic", "Select a file type:") End Sub Sub StripText() Dim sStripText = New String(){".ipt", ".iam" ,".ipn" ,".idw" ,".dwg"} oStripText = InputListBox("Select one:", sStripText, sStripText(0), _ "iLogic", "Select text to remove:") End Sub Sub GetFolderPath() 'check for existing path If SharedVariable.Exists("oFolderName") = True Then 'get uer input oReuse = MessageBox.Show("Do you want to use this folder again:" & _ vbLf & SharedVariable("oFolderName"), "iLogic",MessageBoxButtons.YesNo) End If If oReuse = vbYes Then 'set path to the folder used prviously oPath = SharedVariable("oFolderName") Else 'let user choose folder Dim dialog = New FolderBrowserDialog() ' dialog.SelectedPath = Application.StartupPath dialog.ShowNewFolderButton = True ' openFileDialog1.InitialDirectory If DialogResult.OK = dialog.ShowDialog() Then oPath = dialog.SelectedPath SharedVariable("oFolderName") = oPath Else MessageBox.Show("No Folder Selected.", "iLogic") Return End If End If End Sub Sub RenameFiles() 'check for empty path If oPath = "" Then Return 'exit rule Else 'give the user a chance to back out RUSure = MessageBox.Show("Are you sure you want to remove " & _ oStripText & " from all of the " & oFileExtension & " files?", _ "iLogic",MessageBoxButtons.YesNo) If RUSure = vbNo Then Return 'exit rule Else End If End If 'loop through foldr looking for step files For Each oFile As String In Directory.GetFiles _ (oPath, "*" & oFileExtension ,IO.SearchOption.AllDirectories) 'convert file name to string Dim sName As String = oFile If sName.Contains(oStripText) Then 'get length of file name Dim iLen As Integer = Len(sName) 'set new name by discarding the last # characters of the file name 'where # of characters is length of oFileExtension & oStripText Dim oNewName As String oNewName = Left(sName, iLen - Len(oFileExtension) - Len(oStripText) ) 'check for exsiting file with the new name If File.Exists(oNewName & oFileExtension) Then 'inform user And skip file MessageBox.Show("A file named " & oNewName & oFileExtension & _ " already exists." & vbLf & sName & " will not be renamed.", "iLogic") Continue For'skips rename Else 'rename the file File.Move(Path.Combine(oPath, oFile), Path.Combine _ (oPath, oNewName & oFileExtension)) End If End If Next End Sub
Can't find what you're looking for? Ask the community or share your knowledge.