Quote and space in Vbscript

Results 1 to 5 of 5

Thread: Quote and space in Vbscript

  1. #1
    xav Guest

    Default Quote and space in Vbscript

    I need to delete a file I list on my server with the delete file command.<BR><BR>the problem is that some filename got space in the middle. How can I get the function to take it?<BR><BR>i.e. delf.deletefile ("server/blabla/" & kl) where kl is the name of the file I pull out a form.<BR><BR>Thanks for any help.<BR>

  2. #2
    Manpreet Guest

    Default RE: Quote and space in Vbscript

    There is an excellent function available in vbscript - The Replace Function.<BR>U could first take the name of the file (from the form<BR>) and then store it as a string variable. after which u could simply use the replace function as this:<BR><BR>newname = Replace(oldname, ".txt", "") &#060;&#060; here i have replace the "txt" extension from the file name with a "" , which means nothing!<BR><BR>Enjoy!<BR>

  3. #3
    xav Guest

    Default RE: Quote and space in Vbscript, yes but...

    Thanks but it doesn&#039t change the name of the file in the directory. So it still gives me a file not found.<BR><BR>I got some files on my server I want to email or delete, the vb function just seem to have an impossibility to handle filename with space.<BR><BR>Any suggestion?

  4. #4
    Mark Wilson Guest

    Default RE: Quote and space in Vbscript

    Try replacing the space by %20<BR><BR>i.e.<BR><BR>hello world.doc becomes hello%20world.doc<BR><BR>this should work if the delf.deletefile method expects a URL for the file name


  5. #5
    xav Guest

    Default RE: Quote and space in Vbscript, Yes but again...

    Tried that but it didn&#039t work, thanks anyway.<BR><BR>Seems like the VBScript function wants the real name of the file and no space in it...<BR><BR>Any other suggestions?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •