southboyj Posted December 31, 2009 Posted December 31, 2009 Any advice will be greatly appreciated.1 - I am asking the user for input $UserID entry is in DOMAIN\USER format (and is admin on target PC)$Computername has been entered as computername, IP address and \\computername and \\IP address2 - Mapping the C$ drive of another computer3 - Copying a file from the same directory as the script to that drive. So far, I am not able to map the drive successfully. Is there some syntax error in the DRIVEMAPADD line? Something else?Script is as follows:$UserID = InputBox ("User Name", "Enter User name", "", "")$Password = InputBox ("Password", "Enter Password","", "X")$ComputerName = InputBox ("Computer Name", "Enter Computer Name","", "")DriveMapAdd ("J:", "$Computername\c$", 0, "$UserID", "$Password")FileCopy ("@ScriptDir\Filename.txt","J:", 1)
tlman12 Posted December 31, 2009 Posted December 31, 2009 (edited) try $UserID = InputBox ("User Name", "Enter User name", "", "") $Password = InputBox ("Password", "Enter Password","", "X") $ComputerName = InputBox ("Computer Name", "Enter Computer Name","", "") DriveMapAdd ("J:","\\" & $Computername & "\c$", 0, $UserID, $Password) FileCopy (@ScriptDir & "\Filename.txt","J:", 1) you can just enter an IP or Computername with out any slashes Edited December 31, 2009 by tlman12
southboyj Posted January 1, 2010 Author Posted January 1, 2010 On 12/31/2009 at 8:52 PM, 'tlman12 said: try $UserID = InputBox ("User Name", "Enter User name", "", "") $Password = InputBox ("Password", "Enter Password","", "X") $ComputerName = InputBox ("Computer Name", "Enter Computer Name","", "") DriveMapAdd ("J:","\\" & $Computername & "\c$", 0, $UserID, $Password) FileCopy (@ScriptDir & "\Filename.txt","J:", 1) you can just enter an IP or Computername with out any slashes Thanks for the quick response. I will try this when I return t work next week.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now