How change file extention in folder?

gymamal
09-06-2009, 02:19 AM
Hi,

I need to change all files, extension to other one when my program opens & again change it to normal when program exit~!

ex:

1) I have a folder which have .txt files!
2) I want change all .txt files to any other extension! Like .ddd
3) when My program starts, all .ddd files must changed to .txt
4) when my program exit, .txt files must changed to .ddd

Thanks!
Please Expect your support!

vb5prgrmr
09-06-2009, 06:15 AM
Why change them? If you are reading the files with your program with the open statement, line input/input statements, and close statement, it does not matter what extension your files are.

However, if you must change them for whatever reason, then use the dir command to retrieve them, and array to store the old names, and array to store the new names, and name to rename the files.



Good Luck

mkaras
09-06-2009, 06:35 AM
I agree. It would take a very strong case to convince me that it was necessary rename all the file extents in the manner described by qymamal.

The only reason I can think of why someone would want to do something like this is to re-use some existing code that only works with .txt files. Now if that is the situation then I would suggest to tweak the existing code so that it will work with file name strings with explicitily specified extensions instead of just implied .txt extensions.

mkaras

gymamal
09-06-2009, 07:33 AM
Hi,

I actually need to rename extension is for a little security! I need to use my swf movies with my program only! (for the present I can not embed swf's) if I freely keep my swf's user can copy them to any where else & see manually! I simply need to avoid this!

If I embed swf's I need to know, How to link multiple swf controls.
I mean,

I have a main swf & some others. If other swf control plays the movie, main swf not shows. (visible = false) but after one of other swf come to end of play, other swf must disappear & main sfw must come to see!

I think now you can understand the problem! Expect your support!
Thanks!

mkaras
09-06-2009, 08:24 AM
There are 110 better ways to keep users from using the data files you include with your program than by simply hiding the actual extensions. I'll list some examples below. In the mean time let me ask, if .ddd is good enough for your sense of secirity them why not have the code that processes the .swf file data take an file name string that ends with .ddd?

Security Improvements....
a - Encrypt the data in the files. Decrypt at time of use.
b - Use an archiver library for VB6 and store all your files into an encrypted ZIP archive using a non--zip extension name for the archive.
c - Roll your own binary globbing software to place all your .swf datas into a single custom binary file only your program knows how to read.

mkaras

gymamal
09-06-2009, 09:52 AM
There are 110 better ways to keep users from using the data files you include with your program than by simply hiding the actual extensions. I'll list some examples below. In the mean time let me ask, if .ddd is good enough for your sense of secirity them why not have the code that processes the .swf file data take an file name string that ends with .ddd?

Security Improvements....
a - Encrypt the data in the files. Decrypt at time of use.
b - Use an archiver library for VB6 and store all your files into an encrypted ZIP archive using a non--zip extension name for the archive.
c - Roll your own binary globbing software to place all your .swf datas into a single custom binary file only your program knows how to read.

mkaras

Hi,

mkaras thanks for reply! Yes It's interesting have security improvements you said! But with my very limited of knowledge in vb I don't know that how to do it!

Can You please, help me to do this? Please expect your help!

Thanks!
Have a niceday!

vb5prgrmr
09-06-2009, 06:47 PM
Yahoo and google can be your friends with any of the suggested improvements....

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum