SPONSORS:






User Tag List

Results 1 to 3 of 3
  1. #1
    Member
    Join Date
    Jun 2001
    Location
    Bedford, MA, USA
    Posts
    85
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    GetProgramDir() returning a UNC path

    SilkTest's GetProgramDir() function is returning a UNC style path: i.e. \\MachineName\foldername
    when the script is located in a mapped drive.

    Example: If I open & run a script from C:\Temp\Auto, a GetProgramDir() call returns "C:\Temp\Auto" as expected.

    However, if drive "Q" is mapped to C:\Temp and I open & run the script from Q:\Auto, GetProgramDir() returns
    "\\MachineName\Auto".

    The problem is, this breaks things like:
    SYS_SetDir( GetProgramDir() )
    or
    SYS_Execute( GetProgramDir()+ "\abc.bat" )

    Does anyone know:
    1) Is this a SilkTest bug? (seems so to me)
    2) Is this a feature-and I just don't get it?

    It's a convention for our users to run automation from a mapped drive, so this is a real problem for us.

    I appreciate all input from the Silk swamies!
    Thanks
    - Jim






    ------------------

  2. #2
    Senior Member
    Join Date
    Jul 1999
    Location
    Bellingham, WA USA
    Posts
    1,323
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: GetProgramDir() returning a UNC path

    Jim,

    I've never see UNC paths cause a problem. We tend to prefer them to guarantee script portability. What you have mapped as drive W: might be drive G: for me and if the script uses a mapped drive letter that will be a problem.

    Now, it may be something specific to SYS_ Execute(). I may need to play with that to be certain...

    ------------------

  3. #3
    Member
    Join Date
    Jun 2001
    Location
    Bedford, MA, USA
    Posts
    85
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: GetProgramDir() returning a UNC path

    DJGray,
    First of all, thanks for your response.

    It's important for our users to be able to run the scripts from any folder, including a a remote file server via a mapped drive. As you say, the drive letter can vary from one user to another. That's OK! All I need to determine (dynamically) is where the script is currently running. If GetProgramDir returned a consistant path format, we would be good to go.
    --------------------------------------
    Here's some more info on SYS_Execute and UNC paths.

    Apparently SYS_Execute can not handle a UNC path that has more than one directory level. For example:
    This works:
    SYS_Execute("\\MyComputer\sqa\abc.bat")
    This fails:
    SYS_Execute("\\MyComputer\sqa\Auto\abc.bat")

    Here's the output from the above SYS_Execute.
    CMD.EXE was started with
    '\\MyComputer\sqa\Auto' as the current directory path. UNC paths are not supported. Defaulting to Windows directory.
    -------------------------------------

    Also, the DOS 'CD' command (change directory) can not handle UNC paths.
    We use Silk to generate and run bat files on the fly, and we use the output of GetProgramDir as the path to 'CD' to.

    - Jim



    ------------------

 

 

Posting Permissions

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

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 11:00 PM.

Copyright BetaSoft Inc.