Link to home
Start Free TrialLog in
Avatar of NAORC
NAORC

asked on

Renaming File Types

Hi Guys.. easy one for y'all..

I have a program that feeds lines of text into a .txt file (C:\update.txt)

the way i have designed it to output the results means if i change the file extension to .bat, it will become a working batch file.  how do i change the extension in vb6?

I do have filesystemobject setup and running :)
Avatar of cquinn
cquinn
Flag of United Kingdom of Great Britain and Northern Ireland image

Why not create the file as C:\update.bat in the first place?

Avatar of NAORC
NAORC

ASKER

Set m_destTS = m_fso.CreateTextFile("C:\ORCGravity\update.txt", True)

^^throws up errors if i do^^
ASKER CERTIFIED SOLUTION
Avatar of Mark_FreeSoftware
Mark_FreeSoftware
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mike Tomlinson
"how do i change the extension in vb6?"

In VB6, you can use the Name function to rename a file:

    Dim oldFileName As String
    Dim newFileName As String
   
    oldFileName = "c:\someFile.txt"
    newFileName = "c:\someFile.bat"
   
    Name oldFileName As newFileName