The supported way to start IDS on Windows is to start the IDS Windows service, which has the same name as your INFORMIXSERVER value. See an earlier blog post for various ways to do this: Ways to start IDS on Windows.
A batch file to emulate UNIX oninit
Here is a batch file that will start IDS and exit, acting just like the UNIX oninit. If you put this somewhere in your path before %INFORMIXDIR%/bin you can call it oninit.bat and you're done. If you can't guarantee it will be before oninit.exe in your path, you might have to settle for calling it something else, like onstart.bat..
@echo offrem Windows batch file to mimic UNIX oninit usage
rem check for parameters which should display usageif %1test==--test goto callexeif %1test==-?test goto callexeif %1test==--helptest goto callexeif %1test==-helptest goto callexe
rem check for other parameters which should call oninit directlyif %1test==-dtest goto callexeif %1test==-Vtest goto callexe
rem start IDS%INFORMIXDIR%\bin\starts %INFORMIXSERVER% %*goto end
Note: Just like oninit on UNIX, this script assumes your environment variables PATH and INFORMIXSERVER are set correctly. However, since all this is doing is starting the IDS service, the rest of the Informix environment variables will be read from the Registry.
Now suppose you want an oninit.bat file that you can put in %INFORMIXDIR%\bin and always work, regardless of the path? This is a little more complicated because an executable file of the same name as a batch in the same directory is executed by the operating system first. I do have this working, but it isn't pretty, and is certainly not supported. It involves renaming oninit.exe, and doing binary edits on onscpah.exe, oninit.exe, ontape.exe, onbar_d.exe, onmode.exe.
Suppose further that you wanted the executable oninit.exe to behave just like it does on UNIX - to start IDS and exit, and read its environment variables from your command shell environment rather than the Registry just like UNIX? This can be done, and is something we're thinking about implementing in a future version. From an engineering perspective it isn't too much work. If you use IDS on Windows or in a multi-platform environment and think this is a worthwhile feature please let me know.