Mombu the Microsoft Forum

  Mombu the Microsoft Forum > Microsoft > Windows NT Server (TECHNET) > To Read a full path from textfile to map a network drive


User Name
Password
REGISTER NOW! Search Today's Posts Mark Forums Read


Reply
 
Thread Tools Search this Thread Display Modes
1 29th March 09:19
ann
External User
 
Posts: 1
Default To Read a full path from textfile to map a network drive



I am new to vb.Actually i want to map a network drive.But
i need to accept the path from a text file.For mapping
the network drive,i'm using the net use command.

Sample File(fileshare.txt)

U,abc.xyz.com,sharefolder,username,password

can any body help me in doing this.It's very urgent.
  Reply With Quote
SPONSORED LINKS BY GOOGLE

 


2 29th March 09:19
phil robyn [mvp]
External User
 
Posts: 1
Default To Read a full path from textfile to map a network drive



Batch command (all one line):

for /f "tokens=1-5 delims=," %%a in (FileShare.txt) do net use %%a: \\%%b\%%c %%e /user:%%d

--
Phil Robyn
Univ. of California, Berkeley

u n z i p m y a d d r e s s t o s e n d e - m a i l
  Reply With Quote
3 29th March 09:20
anonymous
External User
 
Posts: 1
Default To Read a full path from textfile to map a network drive


net use %%a: \\%%b\%%c %%e /user:%%d

thank you very much.It worked
  Reply With Quote
4 29th March 09:20
anonymous
External User
 
Posts: 1
Default To Read a full path from textfile to map a network drive


plz.......don't get angry with me.help me plz....
can u tell me what is to be done if the textfile contains
more than 1 line of data?What i want is to copy some
specific files from that mapped drive to anywhere and vice
versa.That text file contains not only the network path
but also the files to be copied to and fro.

Sample File(fileshare.txt)

U,abc.xyz.com,sharefolder,username,password
abc.tgz,xyz.xxl,pqr.xml..............(files to be copied
from the mapped drive)
abc.tgz,xyz.xxl,pqr.xml..............(files to be copied
to the mapped drive)
d,xyz(destination path)
  Reply With Quote
5 29th March 09:20
phil robyn [mvp]
External User
 
Posts: 1
Default To Read a full path from textfile to map a network drive


Have your VB program parse FileShare.txt, create and execute
a multi-line batch file by using Shell().

@echo off
net use u: \\abc.xyz.com\sharefolder password /user:username
for %%a in (abc.tgz xyz.xxl pqr.xml ...) do (
copy u:\directory\%%a c:\destination
copy c:\source\%%a u:\xyz
)
net use u: /delete

--
Phil Robyn
Univ. of California, Berkeley

u n z i p m y a d d r e s s t o s e n d e - m a i l
  Reply With Quote
6 29th March 09:20
anonymous
External User
 
Posts: 1
Default To Read a full path from textfile to map a network drive


yaa i have to read the files from the fileshare.txt.The
number of files is not fixed.it may vary depending upon
the requirement
  Reply With Quote
SPONSORED LINKS BY GOOGLE

 


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes







Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
Also visit Ogoun the Usenet Archive
666