Jump to content

Recommended Posts

Posted

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 address

2 - Mapping the C$ drive of another computer

3 - 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)

Posted (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 by tlman12
Posted

  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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...