Accessing network shares on another server
#1
Scooby Regular
Thread Starter
Join Date: Mar 2003
Location: LA LA Land
Posts: 831
Likes: 0
Received 0 Likes
on
0 Posts
I want to be able to access a share on another server from a batch file
The servers do not share common usernames and passwords.
The application accessing the share does not recognise mapped drives, ie i cant use "net use" statements to map drives first
Basically i want to copy a files from one server to another
I know you can use the /user XXXX XXXXX switch when mapping a drive but how do you specify a username and password when copying like this:
copy h:\HTML\*.* \\192.168.10.1\html
This is on Windows 2000
HELP PLEASE
[Edited by jpmason33 - 9/18/2003 10:01:51 AM]
The servers do not share common usernames and passwords.
The application accessing the share does not recognise mapped drives, ie i cant use "net use" statements to map drives first
Basically i want to copy a files from one server to another
I know you can use the /user XXXX XXXXX switch when mapping a drive but how do you specify a username and password when copying like this:
copy h:\HTML\*.* \\192.168.10.1\html
This is on Windows 2000
HELP PLEASE
[Edited by jpmason33 - 9/18/2003 10:01:51 AM]
#2
Scooby Regular
basically you can't.
you need to authenticate first either by mapping a drive or by using the NET USE \\SERVER\SHARE /USER: PASSAWORD command.
You could map a drive, perform the copy then delete the drive mapping for example.
Stefan
you need to authenticate first either by mapping a drive or by using the NET USE \\SERVER\SHARE /USER: PASSAWORD command.
You could map a drive, perform the copy then delete the drive mapping for example.
Stefan
#5
you need to do a "net use" to the machine first in my limited experience.
so "net use \\server\share /user:user password"
Then you'll get ad hoc access.
This is admittedly not the greatest - perhaps there is a proper way?
so "net use \\server\share /user:user password"
Then you'll get ad hoc access.
This is admittedly not the greatest - perhaps there is a proper way?
#6
Scooby Regular
I would say the "proper" way (or the Microsoft way) is to have the machines in the same domain or active directory tree and have permissions set that way. Then there's no need to use NET USE commands as the username/password will be passed during the connection and authenticated by the domain controller.
Stefan
Stefan
#7
Scooby Regular
Thread Starter
Join Date: Mar 2003
Location: LA LA Land
Posts: 831
Likes: 0
Received 0 Likes
on
0 Posts
that works if called from the command prompt, however, the application is a service that logs on with the local system account.
When the application calls the batch file it doesnt work.
Any thoughts?
When the application calls the batch file it doesnt work.
Any thoughts?
Trending Topics
#8
Scooby Regular
one option is to set the username/password on the service itself. the username would have to have permissions to logon as a service and access to both the local folders and the remote share.
That way when the service starts it can authenticate to the remote share without needing to use a NET USE command.
The batch file you have created, is it a .BAT or a .CMD file?
Stefan
That way when the service starts it can authenticate to the remote share without needing to use a NET USE command.
The batch file you have created, is it a .BAT or a .CMD file?
Stefan
Thread
Thread Starter
Forum
Replies
Last Post