Tech Support > Operating Systems > MS-DOS > batch file reading server share that's not mapped
batch file reading server share that's not mapped
Posted by Becky on March 31st, 2005


I have a batch file below (thanks to a couple kind souls here) and I want to
run it to read files on server shares. I don't want to have to map drive
letters to these shares. Is it possible to change the code to look for
\\servername\sharename\folder\subfolder instead of f:\mydocs???


@echo off
for %%a in (h:\docum\mydocu~1\saveit\storage\*) do call :main %%~ta %%~nxa
goto :EOF

:main
set entry=%*
for /f "tokens=1-3* delims= " %%a in (
"%entry%"
) do echo %%a, %%b, %%c %%d>>c:\MyCSVFile.txt



thanks


Posted by Rauf Sarwar on March 31st, 2005



Becky wrote:
Yes. Just replace h:\docum\mydocu~1\saveit\storage\* with
\\servername\sharename\folder\subfolder\*

Regards
/Rauf


Posted by J. David Boyd on March 31st, 2005


"Becky" <Some@dude.com> writes:

Why not try it and find out?

Dave

Posted by David Trimboli on April 1st, 2005


Becky wrote:
Replace "f:\mydocs" with "\\servername\sharename\folder\subfolder" in
the code, and make sure the account the script is running under has
access to the share. If it doesn't, use "net use" to get access.

For instance,

net use \\servername\sharename\folder\subfolder /u:mydomain\myuser *

David
Stardate 5250.6


Similar Posts