We help IT Professionals succeed at work.

Execute .NCF from a Windows Batchfile

benni
benni asked
on
263 Views
Last Modified: 2006-11-17
I want to execute a NCF on the Novell Server from a Windows batch.
I've mapped drive N: to the server and I want to do something like that:

@echo off
execute SERVER:\stop_this_service.ncf
copy N:\somedir\somefiles.* N:\otherdir\
execute SERVER:\start_this_service.ncf

I don't know how to do it!

Comment
Watch Question

Commented:
NCFs can only be run from the console command line.  Running an NCF from a client requires a program that calls the Netware API to run an NCF on the server.  Even if you had such a utility (it would be very easy to write one), you would likely be disatisfied with the inability to synchronize your client side program with the NCF, i.e., all you can do is request execution of the NCF - control returns right away and you have no generic way to determine when the NCF has completed - or even if it started properly.
Benni,

This NCF is to stop and start Oracle instance ?

Both directory are on server ?

Commented:
Rconsole, than you have control to!
No can do, a maped drive gives a "DOS" command prompt and NCF files can only be run from a "Netware" command prompt and this means at the server console and nowhere else.
One possibility is to use something like Arcserve. You can execute Netware console commands (including NCF files) pre and post job and it will also do immediate or scheduled disk to disk copies as well. If you use something else for backup check it's features, it will probably do something similar.

Author

Commented:
andrewbrazier: I believe this andwers isn't correct. It should be possible to execute NCFs from a client, even if they are not synchronized to the batch.

defferrari: not oracle, one directory is a local drive

sverre: have rconsole command line possibilities?


Is there a utilities like cookre described it?

What NW version ?
This may be possible with NW5
Nope, you just can't do it. An NCF file contains Netware commands, a DOS prompt only uderstands DOS commands, try typing LOAD MONITOR at a DOS prompt and see what you get. Alternatively try typing COPY and a Netware console prompt and see what happens.
As I mentioned earlier you can do this with Arcserve or some other third party backup utility but not with DOS batch files.
As for the utility that cookre describes this would be a pretty major security hole and I wouldn't want it anywhere near my LAN even if it existed and I'm pretty certain it doesn't.
You would not expect Unix commands to work in DOS and it's the same thing with Netware, from the client side it LOOKS like DOS (F:. G:, etc), but it isn't. You only see it's command line interface at the server and this is the only place you can type in Netware commands (including NCF files).
If you use cron on netware and AT command of a scheduler on Windows machine, you can sync this two jobs to work fine.

# Netware CRON at 02:00
>stop service

# Windows AT command at 02:30
>copy from server to workstation

# Netware CRON at 05:00
>start service

Author

Commented:
andrewbrazier: I think you misunderstand me. In fact I can run Unix commands from a Windows Batch via a telnet script. I think there should be a tool which allows to do the same with netware.
btw - rconsole gives me the complete console on a client and IMHO this is not really a security hole.

defferrari: good idea, but this is not a answer to my question

Author

Commented:
pwoolford: we are using NetWare 4.2
pwoolford: how use access a device in a workstation from a Netware Server ?

Arcserve use Client Agent to do this.

Commented:
If you like, I'll write the utility for you tonight.  Bear in mind, however, it must be run from an authenticated connection under a userid with console authority (that's a requirement of the API call that submits an NCF from a client).

Author

Commented:
cookre - you would do that for 100 points? Is it possible to set the parameters for the connection in a Inifile or via command line parameters?

Commented:
Proposed usage:

runncf  <servername>  <filenamewithvolume>

Commented:
Besides, it seems like a useful thing - I'm kinda surprised one doesn't already exist (maybe I'll find out tonight why).

Author

Commented:
cookre - good, where do I set login and pw?

Commented:
The program assumes there is already a connection with console rights to the specified server.

Requiring a userid and password on either the command line or in an ini file would mean those items would be in plain text for prying eyes to see and snooping fingers to find.

Now, one could embed a fixed userid and password in the program, but, to make the program useful, that userid would have to be:

1) the same bindery id & password on ALL servers

2) an id with god rights to the root of the tree (or, at least, to those containers your target servers are in)

Commented:
http://www.novellshareware.com/nlms.shtml#442

Nettools and some others there will do this function
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
Adjusted points from 100 to 300

Author

Commented:
thanks cookre

it seems to work :-)

is there a way to send the output from the ncf to the console screen
at the moment I can't see what happens at the console

I increased the points a little bit, please tell me if it's not enough

Commented:
Use conlog on the console and just check the logfile!

Author

Commented:
sverre: there are no entrys from the NCFs started via runncf

Commented:
That's one of the side effects of using the API call to run an NCF.  In order to have a command show up on the concole and in the console log, one has to stuff the concole buffer directly, by-passing the API call.

There is an NCP to do this, and some commercial packages use it.  Unfortunately, Novell has not publicly released the details of that NCP and I have been completely unsuccessful in prying that info from them - despite the thousands of server liscences we have with them.

I saw once that someone wrote a book that supposedly had details on all of the undocumented NCPs (I can't recall her name right now), but, the book had already been out of print (that was four years ago) and no one could find a copy anywhere.

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.