batch file and UNC paths

C

conrad

How does one alternatively get around
the problem of using UNC paths? I have
a batch file in a shared directory
with a file in the same directory. When
the share is accessed, it is unable to read
the file. It seems that problem is due to
the fact that it is a UNC path. What
is a way around this while keeping my
batch file and file it reads in the same
shared directory. I also mapped the drive.
But that didn't work either.

Additionally, are there any standard command
line tools for making modifications to a user's
outlook profile? Such as creating, deleting or
recreating shortcuts, etc?
 
P

Pegasus \(MVP\)

See below.

conrad said:
How does one alternatively get around
the problem of using UNC paths?

*** What problem?
I have a batch file in a shared directory
with a file in the same directory.

*** Let's have a look at the batch file!
When the share is accessed, it is unable to read
the file.

*** How exactly to you access the share?
*** What message do you get when you try to read the file?
It seems that problem is due to
the fact that it is a UNC path.

*** Can you access the file when you use a Drive:Folder path?
What is a way around this while keeping my
batch file and file it reads in the same
shared directory. I also mapped the drive.
But that didn't work either.

*** If this does not work either, what makes you think
*** that the problem is caused by the UNC path?
Additionally, are there any standard command
line tools for making modifications to a user's
outlook profile? Such as creating, deleting or
recreating shortcuts, etc?

*** What exactly to you mean with "creating a
*** shortcut in Outlook"?
 
C

conrad

See below.




*** What problem?


*** Let's have a look at thebatchfile!


*** How exactly to you access the share?
*** What message do you get when you try to read the file?


*** Can you access the file when you use a Drive:Folder path?


*** If this does not work either, what makes you think
*** that the problem is caused by the UNC path?


The relevant part is:
set fl=%CD%\user.txt

if exist %fl% (
for /F "eol= " %%u in (%fl%) do echo %%u:%pwd%
) else (
@echo Unable to locate %fl%
@echo Exiting...
)

Where the echo is currently I'll be using usermod
to modify active directory objects.
*** What exactly to you mean with "creating a
*** shortcut in Outlook"?

There are components in outlook that reference
mail, calendar, etc.And they allow quick access to
one of those components. You also have an
option to create a shortcut to say subfolders
for quick access to subfolders, say a particular
directory for some filtered email. I was just curious
if there was some command line tool that would
allow modification of a user's outlook profile
to change such settings instead of having to
walk a user, over the phone, in creating such
shortcuts.
 
P

Pegasus \(MVP\)

See below.




*** What problem?


*** Let's have a look at thebatchfile!


*** How exactly to you access the share?
*** What message do you get when you try to read the file?


*** Can you access the file when you use a Drive:Folder path?


*** If this does not work either, what makes you think
*** that the problem is caused by the UNC path?


The relevant part is:
set fl=%CD%\user.txt

if exist %fl% (
for /F "eol= " %%u in (%fl%) do echo %%u:%pwd%
) else (
@echo Unable to locate %fl%
@echo Exiting...
)

Where the echo is currently I'll be using usermod
to modify active directory objects.
*** What exactly to you mean with "creating a
*** shortcut in Outlook"?

There are components in outlook that reference
mail, calendar, etc.And they allow quick access to
one of those components. You also have an
option to create a shortcut to say subfolders
for quick access to subfolders, say a particular
directory for some filtered email. I was just curious
if there was some command line tool that would
allow modification of a user's outlook profile
to change such settings instead of having to
walk a user, over the phone, in creating such
shortcuts.

--
conrad

====================

Your original question was about shares and UNC paths.
Your reply makes no reference to UNC paths, hence I am
unable to comment on it.

Your batch file lines
set fl=%CD%\user.txt
if exist %fl% (
may or may not work, depending on your current working
directory. It would be much safer to code like so:
set fl=%CD%\user.txt
if exist "%fl%" (

I also wonder just how robust your code is when using the
%CD% environmental variable. Do you really know at
all times where the user is? If you do, why not hard-code
it into the batch file?

I am not aware of any command line facilities that let
you modify components in Outlook. However, instead
of "walking" to each machine when assisting a user, you
should consider using some remote support tool such as
Remote Assistance or WinVNC.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top