Jump to content

UNC Path to local host


Recommended Posts

Guest E-Double
Posted

Is there some general way to make a UNC path point to the local host - like

the localhost entry does for URL paths? Ideally a batch file would be

created that could be used on any machine but that would point to that local

machine at the beginning of the path to run some scripts - i.e.

\\localhost\program files\. For some reason this is not working with a

universal way to point to the local machine. Using C:\program files is not

an option for this particular script, and editing each batch file to point to

each specific machine by its Netbios name would work but is not an attractive

option given the # of machines. TIA for any help on this one ...

  • Replies 4
  • Created
  • Last Reply
Posted

Re: UNC Path to local host

 

You should be able to accomplish what you need by using the loopback IP

address instead (i.e. \\127.0.0.1\localsharename)...

 

hth

Marcin

Guest E-Double
Posted

Re: UNC Path to local host

 

Perfect, thanks!

 

e.

 

 

 

"Marcin" wrote:

> You should be able to accomplish what you need by using the loopback IP

> address instead (i.e. \\127.0.0.1\localsharename)...

>

> hth

> Marcin

>

Guest Bruce Sanderson
Posted

Re: UNC Path to local host

 

Another possibility may be to use the Environment Variable called

ComputerName - e.g.

 

\\%computername%\c$\program files

 

e.g.

 

dir /ad "\\%computername%\c$\program files"

 

would list the directories in the local c:\program files folder.

 

--

Bruce Sanderson

http://members.shaw.ca/bsanders

 

It is perfectly useless to know the right answer to the wrong question.

 

 

 

"E-Double" <EDouble@discussions.microsoft.com> wrote in message

news:1250FDC2-831A-4926-9FA6-BF54F8A2C591@microsoft.com...

> Is there some general way to make a UNC path point to the local host -

> like

> the localhost entry does for URL paths? Ideally a batch file would be

> created that could be used on any machine but that would point to that

> local

> machine at the beginning of the path to run some scripts - i.e.

> \\localhost\program files\. For some reason this is not working with a

> universal way to point to the local machine. Using C:\program files is

> not

> an option for this particular script, and editing each batch file to point

> to

> each specific machine by its Netbios name would work but is not an

> attractive

> option given the # of machines. TIA for any help on this one ...

Guest E-Double
Posted

Re: UNC Path to local host

 

Perfect, thanks again guys!

 

e.

 

 

"Bruce Sanderson" wrote:

> Another possibility may be to use the Environment Variable called

> ComputerName - e.g.

>

> \\%computername%\c$\program files

>

> e.g.

>

> dir /ad "\\%computername%\c$\program files"

>

> would list the directories in the local c:\program files folder.

>

> --

> Bruce Sanderson

> http://members.shaw.ca/bsanders

>

> It is perfectly useless to know the right answer to the wrong question.

>

>

>

> "E-Double" <EDouble@discussions.microsoft.com> wrote in message

> news:1250FDC2-831A-4926-9FA6-BF54F8A2C591@microsoft.com...

> > Is there some general way to make a UNC path point to the local host -

> > like

> > the localhost entry does for URL paths? Ideally a batch file would be

> > created that could be used on any machine but that would point to that

> > local

> > machine at the beginning of the path to run some scripts - i.e.

> > \\localhost\program files\. For some reason this is not working with a

> > universal way to point to the local machine. Using C:\program files is

> > not

> > an option for this particular script, and editing each batch file to point

> > to

> > each specific machine by its Netbios name would work but is not an

> > attractive

> > option given the # of machines. TIA for any help on this one ...

>

>


×
×
  • Create New...