Focal Point
run a dos command in .fex

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/4031085891

November 28, 2006, 10:23 AM
mbedford
run a dos command in .fex
I am trying to run a dos command in its own .fex file, but the .fex won't run the bat file. The bat file runs successfully when I run it from Windows Explorer.

Below is my code
-* File dos_command_test.fex
-* .fex files can run DOS commands.
-* This test is to show how to run a .bat file within a .fex file.
-* If this test works, the rma_lob_summary and two other lob reports can be renamed to add the date
-* and moved to their respective folders via a bat file that is ran in the Report Caster schedule as a
-* post procedure in the lob report's task.


-DOS C:\BBTDATA\a76362\dos_test_2.bat
-END

-RUN

-EXIT

Thanks in advance,
Morgan
November 28, 2006, 10:31 AM
hammo1j
mbedford

That should work. My guess is that you are describing the location of your batchfile relative to yourself and not relative to the server. ie dos_test_2 is on your machine's disk and not the server's C:

Hope this helps

John



Server: WF 7.6.2 ( BID/Rcaster) Platform: W2003Server/IIS6/Tomcat/SQL Server repository Adapters: SQL Server 2000/Oracle 9.2
Desktop: Dev Studio 765/XP/Office 2003 Applications: IFS/Jobscope/Maximo
November 28, 2006, 10:57 AM
mbedford
Thanks, John. That does make sense. But this leads me to another question. What code do I write in my .fex to tell it that it is on my C: drive?

I would just put the .bat on my server, but it is an AIX box and that does not make sense to me. Eventually, the files the .bat will delete are going to be on a windows server, anyway.

Thanks,
Morgan
November 28, 2006, 12:19 PM
hammo1j
mbedford

Again this is a question of how your server sees the files.

The .bat probably needs rewriting as the unix equivalent. There will have to be some equivalent to a windows filespec to enable the unix machine to pick the files up over the network.

dos del \\machine-name\dir1\dir2\myfile.dat

needs rephrasing into Unixspeak.

Offers anyone?

John



Server: WF 7.6.2 ( BID/Rcaster) Platform: W2003Server/IIS6/Tomcat/SQL Server repository Adapters: SQL Server 2000/Oracle 9.2
Desktop: Dev Studio 765/XP/Office 2003 Applications: IFS/Jobscope/Maximo
November 28, 2006, 08:08 PM
susannah
morgan, try taking the dash out from in front of the DOS command.
I'm on win2k and win2k3 and i prefer the CMD command, but DOS sometimes works.
If i need to map a drive, the DOS command wont work for me, e.g.
CMD NET USE F: /DELETE
CMD NET USE F: \\servername\d$
CMD COPY \\servername\sourcedirname\*.fex \\servername\targetdirname /Y
CMD ERASE \\servername\somedirname\*.*




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
November 29, 2006, 08:41 AM
RichH
Morgan,
Since your on multi-platforms you may want to switch to using APP commands, which work within webfocus and avoind the operating system commands.
The syntax is easy to find but basically it as simple as:
APP DELETEF appname filename filetype
Regards,
Rich


WebFOCUS 8202 Win 2012
Test - WebFOCUS 8203 on Win 2012
November 29, 2006, 08:48 AM
hammo1j
RichH

Using APP commands is pretty smart - wish I had thought of that!

Would still be interested from a Unixer (right term?) as to how they do the equivalent of DOS .bat files.

Another thing (which still applies to APP) is I know how a file in Windows within a windows network is described but how is it done within
Unix and the APP command.

Do you use something like

FILE://machine-name/dir1/dir2/filename.ext?

Regards

John



Server: WF 7.6.2 ( BID/Rcaster) Platform: W2003Server/IIS6/Tomcat/SQL Server repository Adapters: SQL Server 2000/Oracle 9.2
Desktop: Dev Studio 765/XP/Office 2003 Applications: IFS/Jobscope/Maximo
November 29, 2006, 09:35 AM
RichH
Hi John,
The APP commands should work the same way on any platform as there are webfocus commands. If the goal is to just copy and/or delete files that may be a better way to go.
For UNIX you can just issue a
-UNIX unix_command
at the operating system level or create
shell scripts to run.
There are a lot of guides on the internet for converting DOS batch files to shell scripts. These should help get you going.
Regards,
Rich


WebFOCUS 8202 Win 2012
Test - WebFOCUS 8203 on Win 2012