Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

Accessing network shares on another server

Thread Tools
 
Search this Thread
 
Old 18 September 2003, 10:01 AM
  #1  
jpmason33
Scooby Regular
Thread Starter
 
jpmason33's Avatar
 
Join Date: Mar 2003
Location: LA LA Land
Posts: 831
Likes: 0
Received 0 Likes on 0 Posts
Question

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]
Old 18 September 2003, 10:04 AM
  #2  
ozzy
Scooby Regular
 
ozzy's Avatar
 
Join Date: Nov 1999
Location: Scotland, UK
Posts: 10,504
Likes: 0
Received 1 Like on 1 Post
Post

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
Old 18 September 2003, 10:05 AM
  #3  
jpmason33
Scooby Regular
Thread Starter
 
jpmason33's Avatar
 
Join Date: Mar 2003
Location: LA LA Land
Posts: 831
Likes: 0
Received 0 Likes on 0 Posts
Post

I tried that, that still does not work

ARGRRHHHH
Old 18 September 2003, 10:06 AM
  #4  
ozzy
Scooby Regular
 
ozzy's Avatar
 
Join Date: Nov 1999
Location: Scotland, UK
Posts: 10,504
Likes: 0
Received 1 Like on 1 Post
Post

how did you try it? from inside the app or from a command prompt?

Stefan
Old 18 September 2003, 10:06 AM
  #5  
chiark
Scooby Regular
 
chiark's Avatar
 
Join Date: Jun 2000
Posts: 13,735
Likes: 0
Received 0 Likes on 0 Posts
Post

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?

Old 18 September 2003, 10:08 AM
  #6  
ozzy
Scooby Regular
 
ozzy's Avatar
 
Join Date: Nov 1999
Location: Scotland, UK
Posts: 10,504
Likes: 0
Received 1 Like on 1 Post
Post

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
Old 18 September 2003, 10:16 AM
  #7  
jpmason33
Scooby Regular
Thread Starter
 
jpmason33's Avatar
 
Join Date: Mar 2003
Location: LA LA Land
Posts: 831
Likes: 0
Received 0 Likes on 0 Posts
Post

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?

Trending Topics

Old 18 September 2003, 10:21 AM
  #8  
ozzy
Scooby Regular
 
ozzy's Avatar
 
Join Date: Nov 1999
Location: Scotland, UK
Posts: 10,504
Likes: 0
Received 1 Like on 1 Post
Post

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
Old 18 September 2003, 10:26 AM
  #9  
jpmason33
Scooby Regular
Thread Starter
 
jpmason33's Avatar
 
Join Date: Mar 2003
Location: LA LA Land
Posts: 831
Likes: 0
Received 0 Likes on 0 Posts
Post

Ozzy, thanks for that,

thqat seems to work ok
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
JimBowen
ICE
5
02 July 2023 01:54 PM
greg320
Non Car Related Items For sale
6
11 October 2015 11:44 AM
TylerD529
General Technical
2
09 October 2015 01:53 AM
leeturbo2000
Member's Gallery
8
01 October 2015 11:30 PM
Littleted
Computer & Technology Related
4
25 September 2015 09:55 PM



Quick Reply: Accessing network shares on another server



All times are GMT +1. The time now is 03:19 AM.