Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Renaming file extensions

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,35478
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Renaming file extensions
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Renaming file extensions - 6/15/2006 9:57:54 PM   
  bigfatgreedykat

 

Posts: 34
Score: 0
Joined: 2/2/2006
Status: offline
Hello all

I would like to rename an *.xar to *.xls file.

I have been searching web and found numerous examples but all seem very advanced.

Look forward to your replies and thanks in advance if you can help out!

regards

BFGK

 
 
 
Post #: 1
 
 RE: Renaming file extensions - 6/15/2006 10:19:43 PM   
  crazymatt

 

Posts: 296
Score: 0
Joined: 3/4/2005
From:
Status: offline
1. start a cmd-promt
2. type "rename *.xar *.xls"
3. done

Easy enough for ya? =)

Hope it helps!

/CM

_____________________________

-There is only 10 sorts of people, those who understand binary and those who dont.

(in reply to bigfatgreedykat)
 
 
Post #: 2
 
 RE: Renaming file extensions - 6/15/2006 10:23:05 PM   
  bigfatgreedykat

 

Posts: 34
Score: 0
Joined: 2/2/2006
Status: offline
Thanks

I have used a batch file but reason i need to script is because Excel creates 2 xar files under Autosave. I only require 1. Will need to script to determine file size but the first sttage is renaming.
I don't think batch will allow size determination?

Any ideas?

thanks

BFGK

(in reply to crazymatt)
 
 
Post #: 3
 
 RE: Renaming file extensions - 6/16/2006 3:54:49 AM   
  ebgreen


Posts: 4970
Score: 31
Joined: 7/12/2005
Status: offline
Search these fora for "FileSystemObject". That is the object that you will need to use to find the name of the file, get the size, delete one, and rename the other.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to bigfatgreedykat)
 
 
Post #: 4
 
 RE: Renaming file extensions - 6/16/2006 5:57:16 PM   
  DiGiTAL.SkReAM


Posts: 1183
Score: 7
Joined: 9/6/2005
From: Florida, USA
Status: offline
quote:

ORIGINAL: bigfatgreedykat

Thanks

I have used a batch file but reason i need to script is because Excel creates 2 xar files under Autosave. I only require 1. Will need to script to determine file size but the first sttage is renaming.
I don't think batch will allow size determination?

Any ideas?

thanks

BFGK


I beg to differ, sir.
For example, to echo back the size (in bytes) of a file, try typing this at the command line:

      

To determine if a value is greater than another,

      

For best results, re-re-re-read the output of for /?, set /?, and if /?

You won't need much else to do truly amazing things on the command line.

_____________________________

"Would you like to touch my monkey?" - Dieter (Mike Meyers)

"It is better to die like a tiger, than to live like a pussy."
-Master Wong, from Balls of Fury

(in reply to bigfatgreedykat)
 
 
Post #: 5
 
 RE: Renaming file extensions - 6/16/2006 7:55:24 PM   
  bigfatgreedykat

 

Posts: 34
Score: 0
Joined: 2/2/2006
Status: offline
Thats amazing. I really i'm impressed!

I have 2 files in a folder named *.xar. Need to compare sizes and copy smaller file to another folder.

Is this possible with batch file?

Look forward to your reply.

regards

BFGK

(in reply to DiGiTAL.SkReAM)
 
 
Post #: 6
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Renaming file extensions Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts