9 replies
by minkey23 Accepted solution
by rob miners Accepted solution
Click Start, Run and type cmd and press Enter.
At the commmand prompt type net use and press Enter.
It will give you a list of drive mappings and you will be able to see if the batch file below will help you. Copy and paste it into Notepad and save it as dletter.cmd.
In a batch file to save the information you could use:
@echo off
C:
net use > C:\dletter.txt
goto end
:END
Keep us informed as to your progress if you require further assistance.
If you think that any of the posts that have been made by all TR Members, have solved or contributed to solving the problem, please Mark them as Helpful so that others may benefit from the outcome. ;) :D
by minkey23 Accepted solution
The net use command works but the batch file did not work. This is definitely a step in the right direction. I appreciate the help.
Is there a command we can use to invoke a similar command like "net use" when we make a vbs script?
by rob miners Accepted solution
retested the batch file by copying it to notepad and running it. Here is the result.
Status Local Remote Network
-------------------------------------------------------------------------------
OK Z: \\fs2003\e$ Microsoft Windows Network
The command completed successfully.
I don't know how to get it into a VB script but you should be able to call it from a script. Here is a couple of samples to play with.
Set oShell = CreateObject("WScript.Shell")
oShell.Run "test.bat"
Function Tilak()
dim shell
set shell=createobject("wscript.shell")
shell.run "INSTALL.bat"
set shell=nothing
End Function
Keep us informed as to your progress if you require further assistance.
If you think that any of the posts that have been made by all TR Members, have solved or contributed to solving the problem, please Mark them as Helpful so that others may benefit from the outcome. ;) :D
by larryd4 Accepted solution
Give me and idea of what UNC path you want to discover.
A mapped drive?
by minkey23 Accepted solution
by larryd4 Accepted solution
Yo may need to tailor this to your needs but this should do what you need.
Set WshNetwork = WScript.CreateObject("WScript.Network")
Set Drives = WshNetwork.EnumNetworkDrives
For i = 0 to Drives.Count - 1 Step 2
WScript.Echo Drives.Item(i), Drives.Item(i+1)
If Drives.Item(i) = "H:" Then
homepath = Drives.Item(i+1)
Else
End If
Wscript.Echo homepath
Next
by rob miners Accepted solution
Set oWshShell = WScript.CreateObject("WScript.Shell")
sCommand = "t1.bat"
oWshShell.Run(sCommand)
by rob miners Accepted solution
This will run the net use command and save the output to c:\dletter.txt
Option Explicit
Dim objShell
Set objShell = CreateObject("WScript.Shell")
objShell.Run "%comspec% /c c: & net use >dletter.txt "
WScript.Quit
This will run the net use command and save the output to c:\dletter.txt and open it in Notepad.
Option Explicit
Dim objShell
Set objShell = CreateObject("WScript.Shell")
objShell.Run "%comspec% /c c: & net use >dletter.txt "_
& " & notepad dletter.txt"
WScript.Quit
http://www.computerperformance.co.uk/ezine/ezine80.htm
Keep us informed as to your progress if you require further assistance.
If you think that any of the posts that have been made by all TR Members, have solved or contributed to solving the problem, please Mark them as Helpful so that others may benefit from the outcome. ;) :D
This discussion is closed to new replies.
Trending Hardware posts
Sort by Trending