UNC name for $File

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
scott1
Posts: 7
Joined: Wed Apr 28, 2004 12:55 am
Location: Sydney, Australia

UNC name for $File

Post by scott1 »

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
bveldkamp

Post by bveldkamp »

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.
scott1
Posts: 7
Joined: Wed Apr 28, 2004 12:55 am
Location: Sydney, Australia

Post by scott1 »

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.
Hi Berend,

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
Post Reply