LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-22-2008, 01:00 AM   #1
pdelcast
LQ Newbie
 
Registered: Apr 2008
Posts: 12

Rep: Reputation: 0
batch file for accessing a shared file in ubuntu samba


i have a shared file/folder in samba. i would like to create a batch file that would connect a user automatic.

this is the scenario:

- i have a username and password accessing the shared file/folder.
- both username and password should be in batch file, no need to input it by the user.

example:
server name - opn
username - a
password - b
shared folder - Archive

any one would help me in creating a batch file based on the given example, the batch file would be used in mapping the shared folder (Archive) and no need to input the username (a) and password (b) in the server (opn)

the batch file would run in windows xp, windows 98 and windows 2000
 
Old 04-22-2008, 02:18 AM   #2
blacky_5251
Member
 
Registered: Oct 2004
Location: Adelaide Hills, South Australia
Distribution: RHEL 5&6 CentOS 5, 6 & 7
Posts: 573

Rep: Reputation: 61
Here is a Windows command that will map your samba share to a "DOS" drive letter - in this case "Z:".
Code:
net use Z: \\opn\Archive b /user:a
 
Old 04-22-2008, 07:49 PM   #3
pdelcast
LQ Newbie
 
Registered: Apr 2008
Posts: 12

Original Poster
Rep: Reputation: 0
i have tried the command but the error occurred. -

system error 1219 has occurred. multiple connections to a server or shared resource by the same user, using more than one user name, are not allowed. disconnect all previous connections to the server or shared resource and try again.

why this message appear, i was able to establish a connection with a manual browsing to the server with the same username and no error occurred. is there a limitation in a creating a connection in batch file? would you help me to have solution on this matter, i only need one username to access the server with in the same time
 
Old 04-22-2008, 09:53 PM   #4
blacky_5251
Member
 
Registered: Oct 2004
Location: Adelaide Hills, South Australia
Distribution: RHEL 5&6 CentOS 5, 6 & 7
Posts: 573

Rep: Reputation: 61
Sorry, I'm not a Windows guru. I can't help you with this error.
 
Old 04-23-2008, 03:59 AM   #5
konsolebox
Senior Member
 
Registered: Oct 2005
Distribution: Gentoo, Slackware, LFS
Posts: 2,248
Blog Entries: 8

Rep: Reputation: 235Reputation: 235Reputation: 235
perhaps you need to access a share resource with a username and password only once so in the next commands, it can be just something like:
Code:
net use Z: \\opn\Archive
 
Old 04-24-2008, 12:21 AM   #6
pdelcast
LQ Newbie
 
Registered: Apr 2008
Posts: 12

Original Poster
Rep: Reputation: 0
tnx a lot. it seems its working
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
batch file to convert every file in a directory with mencoder. toben Linux - Software 1 01-31-2008 05:28 PM
How to convert a batch file(.bat) to script file(.sh) manas_sem Programming 4 06-28-2007 12:10 PM
wxPython problem: /_core_.so: cannot open shared object file: No such file or directo aregmi Linux - Software 2 06-06-2007 08:53 PM
In samba no permission to see shared file ALInux Linux - Software 1 04-22-2005 07:26 AM
Can't change attributes on a samba-shared file from win98 zen_guerrilla Linux - Networking 0 03-16-2004 07:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration