Using Samba for batch runs in windows

Posted on 2006-05-09
Medium Priority
Last Modified: 2010-03-18
I have not worked on Samba so far. I need some help in setting up this job. I need to run a batch job in windows 2000 server having IIS 5 and Jrun 3.11. The job is to import text files into the database.  The code is in Java.

Do I need to Install Samba on windows? What setup I need to do? Can anyone help me in setting up of this job?

java -Xms64m -Xmx128m -classpath c:\jltclasses\;c:\jrun\lib\ext\jcifs-0.6.5.jar;c:\JRUN\servers\default\ibs\WEB-INF\classes\;C:\javaibs\;c:\jrun\lib\ext\jakarta-oro-2.0.6.jar;c:\jrun\lib\ext\msbase.jar;c:\jrun\lib\ext\mssqlserver.jar;c:\jrun\lib\ext\msutil.jar;c:\JRUN\lib\ext\servlet.jar;c:\JRUN\lib\ext\regexp.jar;c:\JRUN\lib\ext\xalan.jar;c:\JRUN\lib\ext\xercesImpl.jar;c:\JRUN\lib\ext\xml-apis.jar;c:\JRUN\lib\ext\jdbc.jar com.YYY.xxxxx.dataimports.programname smb://yourWindowsUser:itsPassword@yourInboxHost/ftpinbox/aetna/ "JET*" yourdatabaseHost yourdatabaseUser yourDatabasePassword > importReports/report%YMD%.txt

This is a very urgent request. Can someone give me the Information at the earliest?
Question by:sriniram
LVL 27

Expert Comment

ID: 16645029
"I need to run a batch job in windows 2000 server having IIS 5 and Jrun 3.11." - I see no mention of Samba in your question. You may not use it at all...

This line: smb://yourWindowsUser:itsPassword@yourInboxHost/ftpinbox/aetna/
is just a path to some  remote windows share. If this directory is local for that server, where job runs, you may place your local path instead. Try something like 'C:\ftpinbox\aetna\'
LVL 19

Expert Comment

by:Gabriel Orozco
ID: 16645312
I also think the question is not very clear

but if the meaning is these files will reside on a linux server and you want to access them using samba, then what you need is enable samba on the server, and create a simple share (with password)

use this page to do that (Assuming samba is already on the linux server since almost every linux distribution has it nowadays):


Accepted Solution

aravinthrk earned 1500 total points
ID: 16646997
A couple of other ways to do this. See below for a brief Description of what Samba is and where your question is contradicting...

1) Do Map Network Drive in your Win2K server and use the format <drive>:\path\to\file .
2) Assuming the .txt file is present in a ftp server directory, you can use ftp://<ftp-server>/path/to/file.

expanding on Nopius' Post:

You don't have to install any Samba variant for Windows (not that i'm aware of :-) ). Basically Samba is a way to see your Linux boxes in the network from your windows machine. For example, if you want to access the share Songs in MyPC computer which is a windows machine, you do the following from the Start-> Run.. of your Windows PC.


Now what if the Songs directory is present in the Linux machine instead of the Windows machine MyPC? Still you do the same. Lets say the Linux Box's name MyLinux. The following will give access to Songs folder.


So what actually is the difference? Normally, Windows Machines use the native windows networking protocol (WINS for instance). Linux however, by default is incapable of speaking this language. In order for Linux speak this language and hence make the Songs folder available for you in your windows machine when you do \\MyLinux\Songs, it uses this protocol/software called Samba (smb actually).

While the Samba Server allows you to share Linux directories to be seen in Windows, The courterpart, Samba Client allows you to access Windows Share in Linux machines. The simplest way to do this is to point your Konqueror Browser to the windows  share using the url format "smb://yourWindowsUser:itsPassword@yourInboxHost/ftpinbox/aetna/".

So basically means you are trying to access a windows share from a windows PC but using a method that is Linux oriented. This is not required. Instead you can, as Nopius pointed out, use the directly the windows share format of \\somepc\somedirectory or c:\ftpinbox\aetna .

A couple of other ways to do this:

1) Do Map Network Drive in your Win2K server and use the format <drive>:\path\to\file .
2) Assuming the .txt file is present in a ftp server directory, you can use ftp://<ftp-server>/path/to/file.

Hope this helps.

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Suggested Courses
Course of the Month16 days, 9 hours left to enroll

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question