$if 0
Using PB/DOS 3.5.....
These two routines work great under windows 98. Would like to see
if they work under other O/S's as well. If somebody would like to
test them and get back to me, would really appreciate it. Please
note that they have to be run with windows running in a DOS window.
They won't work booting F8 boot-2-dos.
The first code extracts the LFN from SFN.
The second routine renames a file with LFN's allowed.
As I said, both of them work on my machine running windows 98,
but.....
I owe a huge debt of thanks to somebody here on the forum for
routing me in the right direction but I can't find his post to
get the name. Soon as I get the name, I'll give him the thanks
he so richly deserves.
$endif
------------------
[This message has been edited by Mel Bishop (edited July 20, 2002).]
Using PB/DOS 3.5.....
These two routines work great under windows 98. Would like to see
if they work under other O/S's as well. If somebody would like to
test them and get back to me, would really appreciate it. Please
note that they have to be run with windows running in a DOS window.
They won't work booting F8 boot-2-dos.
The first code extracts the LFN from SFN.
The second routine renames a file with LFN's allowed.
As I said, both of them work on my machine running windows 98,
but.....
I owe a huge debt of thanks to somebody here on the forum for
routing me in the right direction but I can't find his post to
get the name. Soon as I get the name, I'll give him the thanks
he so richly deserves.
$endif
Code:
REM ************************ ' REM * Extract LFN from SFN * ' REM ************************ ' ' $lib all off ' color 14,1 ' cls ' ' te$ = dir$("c:\*.*") ' ' do until te$ = "" ' te$ = "c:\" + te$ + chr$(0) ' ASCIIZ terminated ' d$ = string$(260,chr$(255)) ' Max string len of LFN reg 1,&h7160 ' reg 3,2 ' ' reg 5,strptr(te$) ' Segment & offset of SFN reg 8,strseg(te$) ' buffer ' reg 6,strptr(d$) ' Segment & offset of LFN reg 9,strseg(d$) ' buffer call interrupt &h21 ' ' d$ = remove$(d$,chr$(255)) ' Remove excess characters ' from buffer. locate 1,1 : print;te$;len(te$) ' locate 2,1 : print;d$;len(d$) ' while instat=0:wend ' an$ = inkey$ ' if an$ = chr$(27) then exit loop ' te$ = dir$ ' ' loop ' end ' REM ******************************* REM * * REM * Rename a file using short or* REM * long file names. * REM * * REM ******************************* path$ = "c:\mystuff\pb35\lfn\" oldname$ = path$ + "dummy.bat" + chr$(0) newname$ = path$ + "This is the renamed dummy batch file" + chr$(0) reg 1,&h7156 ' ' reg 4,strptr(oldname$) ' Segment & offset of old reg 8,strseg(oldname$) ' file name ' reg 6,strptr(newname$) ' Segment & offset of new reg 9,strseg(newname$) ' file name ' call interrupt &h21 ' end '
------------------
[This message has been edited by Mel Bishop (edited July 20, 2002).]
Comment