Results 1 to 4 of 4

Thread: Opening files on desktop of workstation

  1. #1
    Senior Member
    Join Date
    Jan 2016
    Posts
    160

    Opening files on desktop of workstation

    Is the following command correct to open a file on the desktop of a windows 10 computer?

    Lianja.showDocument("file:///%userprofile%\Desktop\bounder_brochure.pdf")

  2. #2
    Lianja MVP
    Join Date
    Dec 2012
    Location
    Croatia, Zagreb
    Posts
    1,135
    I am not sure you can use %USERPROFILE% here.
    You can get the value of that environment variable with GETENV('USERPROFILE') and maybe construct it
    Last edited by josipradnik; 2022-10-12 at 04:22.

  3. #3
    Lianja Team yvonne.milne's Avatar
    Join Date
    Feb 2012
    Location
    Berkshire, UK
    Posts
    1,842
    Code:
    Lianja.showDocument("file:///"+getenv("USERPROFILE")+"\Desktop\bounder_brochure.pdf")

  4. #4
    Lianja MVP
    Join Date
    Dec 2012
    Location
    Croatia, Zagreb
    Posts
    1,135
    Something like this:

    Code:
    yourfile="bounder_brochure.pdf"
    
    usrprof=getenv('USERPROFILE')
    ?usrprof
    
    zzz=usrprof+"\Desktop\"+yourfile
    ?zzz
    
    Lianja.showDocument("file:"+zzz)

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us