Hi,
Is there a Tool Parameter Macro that will return the UNC name of the file?
I'm editing a file on a mapped network drive (Z: ), and have a complicated tool defined. I need to pass the UNC name of the file as a parameter to the tool. The tool actually executes on a remote machine, which does not have Z: mapped.
Thanks,
Scott
UNC name for $File
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
Hi Berend,bveldkamp wrote:One way would be to open the file from the network location itself, instead of Z: (Browse to My Network Places > Entire Network > Microsoft Windows Network > Computer name > Share)
This would a nice enhancement, though.
Thanks for the reply. Unfortunately, our users just don't work that way. They will map a drive to the UNC name, and different users have different mappings.
The tool invokes a programming language called SAS and runs the file being edited as a batch process. It actually submits it on a remote machine via client/server processing. That machine does not have any drive mappings, but needs to know the (UNC) name of the input file in order to "do the right thing".
A bit of Googling shows that Windows does not make it easy to retrieve the UNC name (type for /? in a command prompt and scroll to the bottom; there are no modifiers to retrieve the UNC name). But I would think TextPad could return the UNC name (is it still being enhanced? it's been a while...)
Fortunately, SAS is good at parsing command output. So, I'm parsing the output from the net use command:
net use z:
Get rid of the string "Remote name" and I get the UNC name that this user has mapped for z:. I can then build the UNC path before I remote submit the job.
If the tool was not a programming language that could capture and parse the net use command output, this would be problematic.
Again, thanks for the reply.
Regards,
Scott