Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

To long file names

can you do anything about the fatct that qb 4.5 only can read short file names( no windows-file names)

Cause I'm making a program in wich I have to rename filenames to shorter ones:, I use this function:



a$ = "file name"

b$ = left$(a$,9)

NAME a$ AS b$



With filenames longer then 8 characters the program can't find the path, If anyone of you has an answer

please help me!!!, I'

I'm nearly desperate




Comments

  • Try creating a function whcih changes the windows file name into a dos file name. To do that take out the space, take out the first six digits, and add a ~1, ~2, ~3, etc depending on how many files start with those six digits. For example:

    VERY VERY LONG FILE NAME.txt = VERYVE~1.txt



    I hope that helped.


  • Thanks for your reply, But I don't think It will do the trick.

    The point is that I have a dir with over 2000 files, all with long file-name, They all start with a code, and after that they have an description.

    I want to sepperate the codes form the description, and the codes are all about 9 characters long.

    So if I want to change the file names to xxx~1 then 2 characters will be missing, and these are very important.



    I was wondering if that new version of qb could read long filenames, or if you use : shell a$; it will use

    A windows kind of ms-dos.

    Anyway, thanks for your reply






  • : Thanks for your reply, But I don't think It will do the trick.

    : The point is that I have a dir with over 2000 files, all with long file-name, They all start with a code, and after that they have an description.

    : I want to sepperate the codes form the description, and the codes are all about 9 characters long.

    : So if I want to change the file names to xxx~1 then 2 characters will be missing, and these are very important.

    :

    : I was wondering if that new version of qb could read long filenames, or if you use : shell a$; it will use

    : A windows kind of ms-dos.

    : Anyway, thanks for your reply





    Ok, to rename files with long filenames with no spaces do this:



    SHELL "ren " + a$ +" " + b$



    if the file name has spaces:



    SHELL "ren " + CHR$(34) + a$ + CHR$(34) + " " + CHR$(34) + b$ + CHR$(34)



    It's messy, but it should work, the CHR$(34) is the code for the quotes that DOS requires when

    a filename has spaces in it.




    URL:http://www.geocities.com/irwinr12/

Sign In or Register to comment.