Problem with $

Hello, I am a begining ASM programer and I am having a problem with a path name. I am trying to delete a file inside a folder with a $ in its path name, when I try to delete the file the program disregards everything after the $ and assumes that I wanted to end the string there, how can I code around this.



lea dx, [bp+tpath]
mov ah, 41h
int 21h

tpath db 'C:PRGMSSQL$LAWSRVStrucTrashOut.jnk'

The problem was that the program kept not working, so I outputed the pathname to the screen and it outputed: C:PRGMSSQL

Thanks for the help


  • The DOS printing function assumes that the string ends with a $ character,
    however the file deleting function still assumes the string ends with 0.
    So the $ is not the problem here.

    Adding the 0 will fix one problem:
    [code]tpath db 'C:PRGMSSQL$LAWSRVStrucTrashOut.jnk',[color=Red]0[/color][/code]
    The second thing to note is that DOS can't handle long file names.
    You can use the old 8.3 format here to make it work:
    tpath db 'C:PRGMSSQL$[color=Red]~1[/color]StrucTrashOut.jnk',0
    Assuming you have no other bugs in your code, it should work now.

    DOS used to be a great way to start in (asm) programming, but it has become more and
    more obsolete each year. I'd recommend that you switch to Windows and avoid
    the hassle. The above program would be a breeze to write in win32 :)
    For example, Fasm and Masm are very good assemblers for win32 and have plenty of
    material online to get you started.

    I hope this helps!
Sign In or Register to comment.

Howdy, Stranger!

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


In this Discussion