from '\\intranet...' to 'C:\'

BeliasBelias Member Posts: 2,998
hi everyone, i know the title is a little bit cryptic, sorry...please suggest me a better one...

anyway, i have a function which runs a file (e.g.: pdf) with HYPERLINK('W:\.....\a.pdf) function, but for this time, i've only this path: '\\intranet.xxx.it\root$' which is mapped as 'W:'
how can i retrieve the 'W:' starting from '\\intranet...'?
is it possible?

(i don't want do create a new setup field for a couple of reasons)
thanks in advance
-Mirko-
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog

Answers

  • garakgarak Member Posts: 3,263
    You need only the UNC?
    Do you make it right, it works too!
  • BeliasBelias Member Posts: 2,998
    what do you mean with UNC? i'm not really familiar with network paths etc... :oops:
    i only need a string wich is the mapped driver for '\\intranet...' address
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • garakgarak Member Posts: 3,263
    Do you mean something like this?

    viewtopic.php?f=5&t=22930
    Do you make it right, it works too!
  • BeliasBelias Member Posts: 2,998
    you got it!...almost... :mrgreen:
    it's what i need but viceversa (i need from sharename to drivename)
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • MBergerMBerger Member Posts: 413
    Do realize that it's not a 1:1 relationship... 1 share might have multiple drive-letters, but a driveletter can just have 1 sharename.
  • BeliasBelias Member Posts: 2,998
    yes, in fact my "problem" is: i know the \\intranet... and from that i'd like to know the actual letter pointing to it...
    am i explaining bad? :cry:
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • garakgarak Member Posts: 3,263
    Belias wrote:
    yes, in fact my "problem" is: i know the \\intranet... and from that i'd like to know the actual letter pointing to it...
    am i explaining bad? :cry:

    And why? :-k

    You can use the vbs example (with some mods [do you need hellp?] ) in the link to go through all mounted drives.
    Do you make it right, it works too!
  • BeliasBelias Member Posts: 2,998
    yes, i need help, because i tried to use (and reverse) the function in your link but i'm not familiar with that automation and i'm a bit lost :oops:
    i need to do this because i have to run HYPERLINK and it doesn't work with \\intranet... but only with W:\
    i just have \\intranet.. address and i don't want to create another setup if i can retrieve W:\ directly from \\intranet...
    otherwise, is there a way to run \\intranet...pdf files in another way different from HYPERLINK?
    thanks
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • garakgarak Member Posts: 3,263
    not with hyperlink (that has also probs with png files or some others) but you can use WSHShell.run or WSHShell.execute (search for both in the forum).
    viewtopic.php?t=12417

    to get all the mapped network drives and their name you can use the following example:
    Name	DataType	Subtype	Length
    WSHNetwork	Automation	'Windows Script Host Object Model'.WshNetwork	
    WSHCollect	Automation	'Windows Script Host Object Model'.IWshCollection	
    i	Integer		
    y	Integer		
    
    
    if isclear(WSHNetwork) then
      create(WSHNetwork);
    
    WSHCollect := WSHNetwork.EnumNetworkDrives;
    i := 0;
    if WSHCollect.count > 0 then beign
      while i <= WSHCollect.count-1 do begin
        y := i + 1;
        message('Drive: ' + format(WSHCollect.Item(i)) + ' = ' + format(WSHCollect.Item(y)));
        i += 2;
      end;
    end;
    

    regards
    Do you make it right, it works too!
  • BeliasBelias Member Posts: 2,998
    wsh.run(a,b,c);

    can work for me, i can directly run \\intranet without retrieving the mapped drive name, thanks al lot!
    have a nice day :mrgreen:
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • garakgarak Member Posts: 3,263
    Please an enjoy the day ....
    Do you make it right, it works too!
Sign In or Register to comment.