|
View Full Version : Rename Map Drive
HI,,
Does any one know this
I have six different Network and i had map network drive throuth script ,but my user face problem of resolving location b'caz i had map using IP address .i don't know how to change label from command prompt or using script.
if any body know pls reply me
Tejal
|
Tejal Patel wrote:
> I have six different Network and i had map network drive > throuth script ,but my user face problem of resolving > location b'caz i had map using IP address .i don't know > how to change label from command prompt or using script.
Hi
Try this in a VBScript:
sDrive = "G:\" ' note the trailing backslash! Set oShell = CreateObject("Shell.Application") oShell.NameSpace(sDrive).Self.Name = "Some description here"
-- torgeir Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: http://www.microsoft.com/technet/scriptcenter
|
Thanks for reply it works but i use Net use comman to map drive mean by making .bat file and run it
do you know how to map network drive through vbscipt
pls reply
tejal >-----Original Message----- >Tejal Patel wrote: > >> I have six different Network and i had map network drive >> throuth script ,but my user face problem of resolving >> location b'caz i had map using IP address .i don't know >> how to change label from command prompt or using script. > >Hi > >Try this in a VBScript: > >sDrive = "G:\" ' note the trailing backslash! >Set oShell = CreateObject("Shell.Application") >oShell.NameSpace(sDrive).Self.Name = "Some description here" > > > >-- >torgeir >Microsoft MVP Scripting and WMI, Porsgrunn Norway >Administration scripting examples and an ONLINE version of the 1328 page >Scripting Guide: http://www.microsoft.com/technet/scriptcenter > > >. >
|
anonymous@discussions.microsoft.com wrote:
> Thanks for reply it works but i use Net use comman to map > drive mean by making .bat file and run it > > do you know how to map network drive through vbscipt
Hi
You can use the MapNetworkDrive method:
http://msdn.microsoft.com/library/en-us/script56/html/wsmthmapnetworkdrive.asp
WSH 5.6 documentation (local help file) can be downloaded from here if you haven't got it already: http://msdn.microsoft.com/downloads/list/webdev.asp
Alternatively, you can shell out from the vbscript and run net use as you are used to:
Set oShell = CreateObject("WScript.Shell") oShell.Run "net.exe use n: \\142.14.62.3\myshare1", 0, True oShell.Run "net.exe use m: \\142.14.62.3\myshare2", 0, True
-- torgeir Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: http://www.microsoft.com/technet/scriptcenter
|
HI..
It works but one problem..
i have made my script in two phase 1) map drive (code) 2) rename that drive (code)
it works fine from my local system but when i will put in my server in my userprofile it map drive but it will not rename it
would you pls help me
tejal >-----Original Message----- >anonymous@discussions.microsoft.com wrote: > >> Thanks for reply it works but i use Net use comman to map >> drive mean by making .bat file and run it >> >> do you know how to map network drive through vbscipt > >Hi > >You can use the MapNetworkDrive method: > >http://msdn.microsoft.com/library/en- us/script56/html/wsmthmapnetworkdrive.asp > > >WSH 5.6 documentation (local help file) can be downloaded from here if you >haven't got it already: >http://msdn.microsoft.com/downloads/list/webdev.asp > > >Alternatively, you can shell out from the vbscript and >run net use as you are used to: > >Set oShell = CreateObject("WScript.Shell") >oShell.Run "net.exe use n: \\142.14.62.3\myshare1", 0, True >oShell.Run "net.exe use m: \\142.14.62.3\myshare2", 0, True > > >-- >torgeir >Microsoft MVP Scripting and WMI, Porsgrunn Norway >Administration scripting examples and an ONLINE version of the 1328 page >Scripting Guide: http://www.microsoft.com/technet/scriptcenter > > >. >
|
anonymous@discussions.microsoft.com wrote:
> It works but one problem.. > > i have made my script in two phase > 1) map drive (code) > 2) rename that drive (code) > > it works fine from my local system but when i will put in > my server in my userprofile it map drive but it will not > rename it > > would you pls help me
Hi
Sorry, this one I have no idea about...
-- torgeir Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: http://www.microsoft.com/technet/scriptcenter
|
Hi Use following to map a drive
On Error Resume Next Dim strRemoteDrive, strMapAs, strUserName, strPassword strRemoteDrive = "\\server\folder" strMapAs= "R:" strUserName = "*****" strPassword = "*****" Set WshNetwork = WScript.CreateObject("WScript.Network") WshNetwork.MapNetworkDrive strMapAs, strRemoteDrive, , strUserName, strPassword Set WshNetwork = Nothing
Use following to map a drive
On Error Resume Next Set WshNetwork = WScript.CreateObject("WScript.Network") WshNetwork.RemoveNetworkDrive "R:" Set WshNetwork = Nothing
Imtaar
|
Hi...
Thanks for reply but manpnetworkdrive is nor working on my desk
do know how to remove drive what ever previously map
not using WshNetwork.RemoveNetworkDrive "R:"
it just disconnect not completly removing
Pls reply
Thanks
Tejal >-----Original Message----- >Hi >Use following to map a drive > >On Error Resume Next >Dim strRemoteDrive, strMapAs, strUserName, strPassword >strRemoteDrive = "\\server\folder" >strMapAs= "R:" >strUserName = "*****" >strPassword = "*****" >Set WshNetwork = WScript.CreateObject("WScript.Network") >WshNetwork.MapNetworkDrive strMapAs, strRemoteDrive, , strUserName, strPassword >Set WshNetwork = Nothing > >Use following to map a drive > >On Error Resume Next >Set WshNetwork = WScript.CreateObject("WScript.Network") >WshNetwork.RemoveNetworkDrive "R:" >Set WshNetwork = Nothing > >Imtaar >. >
|
Hi..
Do you know
how to remove excisting map drive in start up
b'caz my script work with net use command what ever you had given but every time i log in it ask me for password
so do you have any idia why it is asking me for password
Tejal >-----Original Message----- >anonymous@discussions.microsoft.com wrote: > >> It works but one problem.. >> >> i have made my script in two phase >> 1) map drive (code) >> 2) rename that drive (code) >> >> it works fine from my local system but when i will put in >> my server in my userprofile it map drive but it will not >> rename it >> >> would you pls help me > >Hi > >Sorry, this one I have no idea about... > > >-- >torgeir >Microsoft MVP Scripting and WMI, Porsgrunn Norway >Administration scripting examples and an ONLINE version of the 1328 page >Scripting Guide: http://www.microsoft.com/technet/scriptcenter > > >. >
|
Try looking at the output of: NET USE /? And determine your solution to remove existing drive mappings as well as passwords. As for why NET USE asks for a password -- all shares require some sort of credentials to access. If you provide no credentials to NET USE, it assumes the credentials running the command -- which may or may not work. It is up to you to determine the right identity that can complete the NET USE command. -- //David IIS This posting is provided "AS IS" with no warranties, and confers no rights. // wrote in message news:0b6301c3fb19$8d1da3f0$a501280a@phx.gbl... Hi..
Do you know
how to remove excisting map drive in start up
b'caz my script work with net use command what ever you had given but every time i log in it ask me for password
so do you have any idia why it is asking me for password
Tejal >-----Original Message----- >anonymous@discussions.microsoft.com wrote: > >> It works but one problem.. >> >> i have made my script in two phase >> 1) map drive (code) >> 2) rename that drive (code) >> >> it works fine from my local system but when i will put in >> my server in my userprofile it map drive but it will not >> rename it >> >> would you pls help me > >Hi > >Sorry, this one I have no idea about... > > >-- >torgeir >Microsoft MVP Scripting and WMI, Porsgrunn Norway >Administration scripting examples and an ONLINE version of the 1328 page >Scripting Guide: http://www.microsoft.com/technet/scriptcenter > > >. >
|
Tejal Patel wrote:
> I have six different Network and i had map network drive > throuth script ,but my user face problem of resolving > location b'caz i had map using IP address .i don't know > how to change label from command prompt or using script.
Hi
Try this in a VBScript:
sDrive = "G:\" ' note the trailing backslash! Set oShell = CreateObject("Shell.Application") oShell.NameSpace(sDrive).Self.Name = "Some description here"
-- torgeir Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: http://www.microsoft.com/technet/scriptcenter
|
Thanks for reply it works but i use Net use comman to map drive mean by making .bat file and run it
do you know how to map network drive through vbscipt
pls reply
tejal >-----Original Message----- >Tejal Patel wrote: > >> I have six different Network and i had map network drive >> throuth script ,but my user face problem of resolving >> location b'caz i had map using IP address .i don't know >> how to change label from command prompt or using script. > >Hi > >Try this in a VBScript: > >sDrive = "G:\" ' note the trailing backslash! >Set oShell = CreateObject("Shell.Application") >oShell.NameSpace(sDrive).Self.Name = "Some description here" > > > >-- >torgeir >Microsoft MVP Scripting and WMI, Porsgrunn Norway >Administration scripting examples and an ONLINE version of the 1328 page >Scripting Guide: http://www.microsoft.com/technet/scriptcenter > > >. >
|
anonymous@discussions.microsoft.com wrote:
> Thanks for reply it works but i use Net use comman to map > drive mean by making .bat file and run it > > do you know how to map network drive through vbscipt
Hi
You can use the MapNetworkDrive method:
http://msdn.microsoft.com/library/en-us/script56/html/wsmthmapnetworkdrive.asp
WSH 5.6 documentation (local help file) can be downloaded from here if you haven't got it already: http://msdn.microsoft.com/downloads/list/webdev.asp
Alternatively, you can shell out from the vbscript and run net use as you are used to:
Set oShell = CreateObject("WScript.Shell") oShell.Run "net.exe use n: \\142.14.62.3\myshare1", 0, True oShell.Run "net.exe use m: \\142.14.62.3\myshare2", 0, True
-- torgeir Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: http://www.microsoft.com/technet/scriptcenter
|
HI..
It works but one problem..
i have made my script in two phase 1) map drive (code) 2) rename that drive (code)
it works fine from my local system but when i will put in my server in my userprofile it map drive but it will not rename it
would you pls help me
tejal >-----Original Message----- >anonymous@discussions.microsoft.com wrote: > >> Thanks for reply it works but i use Net use comman to map >> drive mean by making .bat file and run it >> >> do you know how to map network drive through vbscipt > >Hi > >You can use the MapNetworkDrive method: > >http://msdn.microsoft.com/library/en- us/script56/html/wsmthmapnetworkdrive.asp > > >WSH 5.6 documentation (local help file) can be downloaded from here if you >haven't got it already: >http://msdn.microsoft.com/downloads/list/webdev.asp > > >Alternatively, you can shell out from the vbscript and >run net use as you are used to: > >Set oShell = CreateObject("WScript.Shell") >oShell.Run "net.exe use n: \\142.14.62.3\myshare1", 0, True >oShell.Run "net.exe use m: \\142.14.62.3\myshare2", 0, True > > >-- >torgeir >Microsoft MVP Scripting and WMI, Porsgrunn Norway >Administration scripting examples and an ONLINE version of the 1328 page >Scripting Guide: http://www.microsoft.com/technet/scriptcenter > > >. >
|
anonymous@discussions.microsoft.com wrote:
> It works but one problem.. > > i have made my script in two phase > 1) map drive (code) > 2) rename that drive (code) > > it works fine from my local system but when i will put in > my server in my userprofile it map drive but it will not > rename it > > would you pls help me
Hi
Sorry, this one I have no idea about...
-- torgeir Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: http://www.microsoft.com/technet/scriptcenter
|
Hi Use following to map a drive
On Error Resume Next Dim strRemoteDrive, strMapAs, strUserName, strPassword strRemoteDrive = "\\server\folder" strMapAs= "R:" strUserName = "*****" strPassword = "*****" Set WshNetwork = WScript.CreateObject("WScript.Network") WshNetwork.MapNetworkDrive strMapAs, strRemoteDrive, , strUserName, strPassword Set WshNetwork = Nothing
Use following to map a drive
On Error Resume Next Set WshNetwork = WScript.CreateObject("WScript.Network") WshNetwork.RemoveNetworkDrive "R:" Set WshNetwork = Nothing
Imtaar
|
Hi...
Thanks for reply but manpnetworkdrive is nor working on my desk
do know how to remove drive what ever previously map
not using WshNetwork.RemoveNetworkDrive "R:"
it just disconnect not completly removing
Pls reply
Thanks
Tejal >-----Original Message----- >Hi >Use following to map a drive > >On Error Resume Next >Dim strRemoteDrive, strMapAs, strUserName, strPassword >strRemoteDrive = "\\server\folder" >strMapAs= "R:" >strUserName = "*****" >strPassword = "*****" >Set WshNetwork = WScript.CreateObject("WScript.Network") >WshNetwork.MapNetworkDrive strMapAs, strRemoteDrive, , strUserName, strPassword >Set WshNetwork = Nothing > >Use following to map a drive > >On Error Resume Next >Set WshNetwork = WScript.CreateObject("WScript.Network") >WshNetwork.RemoveNetworkDrive "R:" >Set WshNetwork = Nothing > >Imtaar >. >
|
Hi..
Do you know
how to remove excisting map drive in start up
b'caz my script work with net use command what ever you had given but every time i log in it ask me for password
so do you have any idia why it is asking me for password
Tejal >-----Original Message----- >anonymous@discussions.microsoft.com wrote: > >> It works but one problem.. >> >> i have made my script in two phase >> 1) map drive (code) >> 2) rename that drive (code) >> >> it works fine from my local system but when i will put in >> my server in my userprofile it map drive but it will not >> rename it >> >> would you pls help me > >Hi > >Sorry, this one I have no idea about... > > >-- >torgeir >Microsoft MVP Scripting and WMI, Porsgrunn Norway >Administration scripting examples and an ONLINE version of the 1328 page >Scripting Guide: http://www.microsoft.com/technet/scriptcenter > > >. >
|
Try looking at the output of: NET USE /? And determine your solution to remove existing drive mappings as well as passwords. As for why NET USE asks for a password -- all shares require some sort of credentials to access. If you provide no credentials to NET USE, it assumes the credentials running the command -- which may or may not work. It is up to you to determine the right identity that can complete the NET USE command. -- //David IIS This posting is provided "AS IS" with no warranties, and confers no rights. // wrote in message news:0b6301c3fb19$8d1da3f0$a501280a@phx.gbl... Hi..
Do you know
how to remove excisting map drive in start up
b'caz my script work with net use command what ever you had given but every time i log in it ask me for password
so do you have any idia why it is asking me for password
Tejal >-----Original Message----- >anonymous@discussions.microsoft.com wrote: > >> It works but one problem.. >> >> i have made my script in two phase >> 1) map drive (code) >> 2) rename that drive (code) >> >> it works fine from my local system but when i will put in >> my server in my userprofile it map drive but it will not >> rename it >> >> would you pls help me > >Hi > >Sorry, this one I have no idea about... > > >-- >torgeir >Microsoft MVP Scripting and WMI, Porsgrunn Norway >Administration scripting examples and an ONLINE version of the 1328 page >Scripting Guide: http://www.microsoft.com/technet/scriptcenter > > >. >
|
|
|
|