Sign in to follow this  
Followers 0
Clay

:(

4 posts in this topic

Why do I always have the bad luck :P ....

Of this is simple, I am just trying to understand why.

So a friend of mine has a script and in it he is using iniread to read an ini style section from a file with a .cfg extension..... When I do the same thing I returned my default which is an empty string... and this will just not work for me unless I change the file extension to .ini

Does anyone know why this would be?

Also, I don't think that Autoit has a file rename function, does anyone know how to change a file extension short of through FileMove?

Share this post


Link to post
Share on other sites



FileMove is generally used as a rename function. Specify the same target location, but with the new file name.

Eg.

FileMove("C:\Temp\file.cfg", "C:\Temp\file.ini")

Share this post


Link to post
Share on other sites

Why do I always have the bad luck :P ....

Of this is simple, I am just trying to understand why.

So a friend of mine has a script and in it he is using iniread to read an ini style section from a file with a .cfg extension..... When I do the same thing I returned my default which is an empty string... and this will just not work for me unless I change the file extension to .ini

Does anyone know why this would be?

Also, I don't think that Autoit has a file rename function, does anyone know how to change a file extension short of through FileMove?

The INI data structure is all that should be relevant. The IniRead() function doesn't care what your file extension is. You could have an extension of .purplemonkeydishwasher and it shouldn't matter as long as the data is sound. I typically/reflexively create a .dat extension for my settings files w/ no issue reading the ini layout.

As for renaming, FileMove() is the only method I'm aware of offhand (short of using Run() command prompt for the DOS method).


- MoChr(77)& Chr(97)& Chr(100)& Chr(101)& Chr(32)& Chr(121)& Chr(97)& Chr(32)& Chr(108)& Chr(111)& Chr(111)& Chr(107)-------I've told you 100,000 times not to exaggerate!-------Don't make me hit you with my cigarette hand...-------My scripts:Random Episode Selector, Keyboard MouseMover, CopyPath v2.1, SmartRename for XP,Window Tracer[sup]New![/sup]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0