View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
leerem leerem is offline
external usenet poster
 
Posts: 88
Default Map Network Drive FAO Gary's Student

Hi,
many thanks for the peice of code as below:

net use d:/delete/y
net use d:"\bft-123456w\d$"/PERSISTENT:yes
pause

wherby d:/ is the Drive letter for the Belfast PC?

without coming over as thick... you said create a file called leerem.bat
containing the code above and then execute the .bat file

Question 1:
Do you mean create an excel file and write the code in the open workbook
section and then save the file as leerem with a .bat extension?

Question 2:
To execute this .bat file would I write the code as follows;

Sub bft()
dim Y as variant ' would variant be correct?
Y=shell(cmd.exe /d D:\leerem.bat",1)

more code

net use d:delete/y ' to disconnect the drive

End sub

Regards
Lee