VBScript and Relative Path

Discussion in 'Programmer's Corner' started by Mazaag, Jul 21, 2009.

  1. Mazaag

    Thread Starter Senior Member

    Oct 23, 2004
    255
    0
    Hi guys..

    I have NO experience whatsoever with VBS. However I am very close to accomplishing what I need....

    Code ( (Unknown Language)):
    1.  
    2. set objFolder2 = objShell.Namespace("E:\Documents")
    3.  
    E:\ is my USB key, which changes with every computer..... I need to set this path such that it runs the folder "Documents" from the CURRENT directory of which the script is run.. ie: a relative path....

    Thanks guys
     
  2. DumboFixer

    Active Member

    Feb 10, 2009
    219
    34
    Could you use this:
    Code ( (Unknown Language)):
    1. currentpath = WScript.ScriptFullName
    to get the path to the script, strip off the filename and add the required filepath
     
Loading...