HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Legacy
- >
- ProLiant Deployment and Provisioning
- >
- Map Drive Script in RDP
ProLiant Deployment and Provisioning
1828934
Members
2206
Online
109986
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2007 03:27 AM
05-10-2007 03:27 AM
Map Drive Script in RDP
Hi everyone,
So I have a script included in a job that installs an application. In order to install, a drive is mapped to the local machine because local environment variables need to be utilized, and it's a much quicker method than copying the install files over.
So here's the VBScript that I'm using:
-----------------------------------------------
'Map Drive to Install Files
On Error Resume Next
strComputer = "."
Set objWMIService=GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery _
("Select * From Win32_LogicalDisk Where DeviceID = 'K:'")
If colItems.Count = 0 Then
Set objNetwork = CreateObject("Wscript.Network")
objNetwork.MapNetworkDrive "K:", "\\server1\publicfolder"
End If
-----------------------------------------------
I have tried running it from the RDP server, I have tried manually copying the file to the destination computer and running it there, I have tried creating a .bat file that runs the .vbs file. I have tried the "net use" command to create the mapped drive -- all to no avail.
If I try running them from the job on the RDP server, it doesn't work, but when I run it through remote desktop on the destination computer, they run fine. It would seem to me that it's a rights issue, but I have tested running the jobs with domain administrator rights and local administrator rights from the RDP server.
I'm running Deployment Server 6.8 on a 2K3 server.
Any help in this matter would be greatly appreciated. Thanks.
So I have a script included in a job that installs an application. In order to install, a drive is mapped to the local machine because local environment variables need to be utilized, and it's a much quicker method than copying the install files over.
So here's the VBScript that I'm using:
-----------------------------------------------
'Map Drive to Install Files
On Error Resume Next
strComputer = "."
Set objWMIService=GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery _
("Select * From Win32_LogicalDisk Where DeviceID = 'K:'")
If colItems.Count = 0 Then
Set objNetwork = CreateObject("Wscript.Network")
objNetwork.MapNetworkDrive "K:", "\\server1\publicfolder"
End If
-----------------------------------------------
I have tried running it from the RDP server, I have tried manually copying the file to the destination computer and running it there, I have tried creating a .bat file that runs the .vbs file. I have tried the "net use" command to create the mapped drive -- all to no avail.
If I try running them from the job on the RDP server, it doesn't work, but when I run it through remote desktop on the destination computer, they run fine. It would seem to me that it's a rights issue, but I have tested running the jobs with domain administrator rights and local administrator rights from the RDP server.
I'm running Deployment Server 6.8 on a 2K3 server.
Any help in this matter would be greatly appreciated. Thanks.
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2007 01:06 AM
05-11-2007 01:06 AM
Re: Map Drive Script in RDP
[I'm assuming your test this from a DOS box]
Seems like the RDP server can't find "server1". Try using server1's IP address.
Seems like the RDP server can't find "server1". Try using server1's IP address.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP