Batch File and MaxL Script
I have a MaxL script that exports level0 data from various cubes. I have a batch file to call that script at daily intervals.
I want to name the output something different each day (preferably NAMEmmdd type format). I realize I can add a rename or move to the batch but wonder if there is a MaxL method that will allow me to export to a different name?
Current MaxL is simply
export database APP.DB level0 data to data_file "'$Arborpath\am1119.txt'";
Ideas or direction to go to learn answer?
T,
J
Hi,
You can pass in variables into maxl, so you the calling batch file can pass in a variable which holds the filename with the current day...
For example you have a batch file
essmsh c:\temp\export.mxl 'C:\temp\output%DATE:~3,2%%DATE:~0,2%.txt'
If that was run today it would pass in 'C:\temp\output1118.txt
Now in your maxl you just reference the variable with
export database sample.basic level0 data to data_file $1;
the $1 relates to the variable which was passed in, the 1 being the position it was passed in.
Cheers
John
http://john-goodwin.blogspot.com/
Similar Messages
-
Call Batch file from MAxl Script
Is it possible to call a windows batch file from a maxl script
If you look at the documentaion you will see there is a shell command available
-
Script to export Security file using maxl script
can anyone provide me the Script to export Security file using maxl script.It should create a log file and a batch file should also be there to schedule the Maxl script.Please help me with this
Hi,
You can use something like
[b]login admin password on localhost;
[b]spool on to 'c:\temp\log.txt';
[b]export security_file to data_file C:\temp\sec_file.txt;
[b]spool off;
[b]logout;
Then you can have a batch file that just calls the maxl script
essmsh name_of_maxl_script.mxl
The batch script can then be scheduled.
Cheers
John
http://john-goodwin.blogspot.com/ -
Remove odbc system dsn using batch file and odbcconf
I create user system dsn entries by using a batch file and odbcconf call. I've found references here on how to do that, yet cannot seem to find any results on how to remove them using that same call. The library information (http://msdn.microsoft.com/en-us/library/ee388579(VS.85).aspx) states add and modify a system dsn for configdsn and configsysdsn and references equivalent to SQLConfgDataSource function. (http://msdn.microsoft.com/en-us/library/ms716476(VS.85).aspx) but the config data source function has a a removal and this doesn't seem too.
Apologies for being obtuse, but I can't seem to locate it. Any links to how this is done from a batch file are much appreciated.
Regards,
NR.John C is basically correct, you can remove a System ODBC data source via the registry, but there is apparently no way via odbcconf.exe. That is of course really stupid and poor programming!
John, however, forgot another important registry entry. That key deletion he mentioned will disable the odbc connection, but not remove it entirely. If you just do that and then open the "ODBC Data Source Administrator", you will find the
connection is still listed, but you can't remove it or modify it. It becomes completely screwed up! There is a value to delete as well which dictates if the connection is listed. Consider it the "header" to the data source.
Also, in Windows 2003 and 2008 at least, the registry key John C listed is not quite the location to modify either. This is where to find them in those OSs:
HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\%DSN%
or
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBC.INI\%DSN%
The "header" I reffered to is a string value in inside a key (not the whole key!)
HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources
or
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBC.INI\ODBC Data Sources
The string value is the data source name. This entry must be removed to remove the data source listing entirely.
Here are some batch snipets for creating and then removing an odbc data source. I'm leaving out some premiliary chunks, but you can figure it out from here. If you can't, you probably shouldn't be messing with this stuff in the first place!
In these scripts, I create and remove a 32-bit data source in either a 32-bit or 64-bit version of windows. The windows folder variable gets set to either "C:\Windows\System32" or "C:\Windows\SysWOW64" depending on the os. In case you didn't
know, on a 64-bit machine there is are also 2 differrent versions of the "ODBC Data Source Administrator" gui tool and the data source lists differ (32-bit vs 64-bit lists). The 32-bit version on a 64 bit OS is found at "C:\Windows\SysWOW64\odbcad32.exe".
The one in the start menu will load the 64-bit version so you will never find your 32-bit connections there.
Note - for simplicity I use the database name as the user name and and the data source name as well (in case there was any confusion).
Create the connection like so:
echo Creating 32-Bit System ODBC Connection "%DatabaseName%"...
"!WindowsFolder!\ODBCCONF.EXE" CONFIGSYSDSN "!ODBCDriver!" "DSN=%DatabaseName%;Server=localhost;Port=3306;Database=%DatabaseName%;UID=%DatabaseName%;PWD=%DatabasePassword%"
And then remove it like this:
echo Removing 32-Bit System ODBC Connection "%DatabaseName%"...
if "%WindowsBits%"=="32" (
If Exist "!TempRegFile!" Del "!TempRegFile!"
echo Windows Registry Editor Version 5.00>>"!TempRegFile!"
echo.>>"!TempRegFile!"
echo [-HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\%DatabaseName%]>>"!TempRegFile!"
echo [HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources]>>"!TempRegFile!"
echo "%DatabaseName%"=->>"!TempRegFile!"
regedit /s "!TempRegFile!"
) else (
If Exist "!TempRegFile!" Del "!TempRegFile!"
echo Windows Registry Editor Version 5.00>>"!TempRegFile!"
echo.>>"!TempRegFile!"
echo [-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBC.INI\%DatabaseName%]>>"!TempRegFile!"
echo [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBC.INI\ODBC Data Sources]>>"!TempRegFile!"
echo "%DatabaseName%"=->>"!TempRegFile!"
regedit /s "!TempRegFile!"
If Exist "!TempRegFile!" Del "!TempRegFile!" -
Calling a batch file in sql scripts
Hi friends,
I am looking for a way to call any batch file in sql scripts.I am avoiding to use DBMS_SCHEDULER package because my application server and database server are diifferent .
I am using the sql script in application server.plz help.<ironic>
Ah, I see. This of course explains everything.
</ironic>
Now to be serious: there is no way to run a batch script from SQL. The tools which submit SQL Statements to the database are often capable of doing so; host in SQL*Plus can issue OS commands, the host builtin in Forms does it too, and with dbms_scheduler you can run a shell script on the database server.
So depending on the tools you are using there are several ways to run OS commands. So far you didn't tell us what you want to do with what tools in which version you want to do it. So to only answer is: this is not possible. You cannot run a batch script from plain SQL.
cheers -
I call a batch file from Oracle forms by clicking on a button. The batch file calls pkzipc utility to extract the contents of a zip file, and place it in the destination xyzfolder. However, this is not working.
The batch file and PKZIPC are located on the same server. When I run the batch file on the server, pkzipc utility works fine. When I call the batch file from Oracle forms, then the utilty is not working.
When-button-pressed trigger has the following code:
declare
the_command varchar2(2000) := '\\ABCserver\ABCfolder\abcd.bat';
begin
host(the_command);
message('done');
end;
batch file code :
cd "\\ABCserver\c$\Program Files\PKWARE\PKZIPC"
pkzipc -extract -silent -nofix -overwrite -directories -logfile \\ABCserver\c$\xyzfolder\26.zip \\ABCserver\c$\sssfolder
exit
How do I resolve this ?
Thanks
SRThe HOST command likely does not have permission to access a file across a network share. This is probably a Windows restriction and has nothing to do with Oracle. Windows Services do not have permission to access shares. Because Forms is a child process to OPMN (which run as a Win Service) the HOST executed from Forms is probably restricted too. For testing to prove this theory, put all the files on the Application Server and it will probably work correctly. Of course the batch code will need to be changed to reflect the local drive and directories.
-
Cfexecute, batch file, and a ftp script
I have a batch file which works fine when entered in at the
command prompt;
C:/temp/mybat.bat
but when I use cfexecute it fails.
Now this may be more of a case of what I am calling than CF
itself.
here is the output:
C:\CFusionMX7\runtime\bin>"C:\Program
Files\Ipswitch\WS_FTP Professional\ftpscrpt" -f
C:\temp\poolsite.scp Processing Line 1 [CONNECT pacmed -p] Finding
Host poolsite... Address lookup of "poolsite" failed. It may be
misspelled, or your computer may not be connected to the network or
Internet. Also check that your DNS and local name servers are
properly configured and responding. Failure in command [CONNECT
poolsite-p] Processing Line 2 [ONSUCCESS SHELL C:/temp/remove.bat]
Set [ONSUCCESS] action to [SHELL C:/temp/remove.bat] Processing
Line 3 [MPUT c:/temp/apptTxfr/*.*] Not Connected Failure in command
[MPUT c:/temp/apptTxfr/*.*] C:\CFusionMX7\runtime\bin>ECHO OFF
the very odd thing, is again, when I call this from a command
line, it works fine.
are there any wrappers or special ways I need to encapsulate
this when using cfexecute?Thank you for the suggestions. The odd thing though, is it
looks like it calling the batch file just fine. It's just that for
whatever reason, the ftp client isn't getting fed the paramters
correctly. Ie
Processing Line 1 [CONNECT poolsite-p] Finding Host
poolsite...
passing -p tells the ftp client to use a prefdefined site
profile (poolsite), instead of using the hostname poolsite.
Basically it is if for whatever reason the ftp program is not
reading it''s scp file correctly when invoked from CF.
I'll check out the permissions and report back.
thanks for the suggestion. -
How run a batch file from VBS script?
I have written a script in which I create a batch file that I want to run. Running it from the Start menu with "Run..." works fine but I would like to do it automatically from the script. I can't find a command that works but I am a beginner, so I'm hoping someone's got a solution?!
Hi again!
Thank you for your help but I've just discovered that my problem probably doesn't have to do with the way that I call for the batch file. It's more like this:
The batch file is run but it only does its job some of the times... The batch contains one name of a converter application (Convert.exe) and the names of some databases and files. I've been told that the conversion should work if Convert.exe is located in the same folder as the files. Which it also does, if I run the batch from "Run..." but not from my code.
I had it working for a while when I had fiddled (as I said, I'm a beginner at this) with setting some drives, such as userDrv and changing some paths in the script settings. Since I didn't really know what I was doing though, I didn't save these settings when closing down DIAdem and now it's not working again. When it worked, it only worked for the file where my .VBS was saved. The point of the program is to convert files in different folders so that wasn't enough.
Just for clearity: I can't write the name as "C:\My Folder..." because the batch file name and the folder it is situated in is different each time so I have variables for the path and the batch, but that part seems to work. (Call ExtProgram(batFilename_) where batFilename_ includes the path).
So I guess what I need to understand is how the different drives work or maybe I need to somehow change my path settings? -
Installing Oracle 11gR2 client from a batch file and it returns before done
Hello,
While installing Oracle 11gR2 client on XP and 7 from a batch file. When it launches the OUI from the batch file, it returns to the batch file before the installer finishes. So, there is no way for my script to know when the installer is done, or to glean a return code to test for success. This is particularly annoying...
I've also used the "call" command to force my batch file to wait, to no avail. Anyone have any clues about this one?
Thanks in advance!
--RobertSrini,
Awesome! Worked like a charm.
Many thanks!
--Robert -
Diference between a batch file and jnlp file
Dear all,
I have a question that might sound simple, but excuse me, coz I am new to jnlp.
I run my appliction using a simple batch file:
set JAVA_HOME=C:\j2sdk1.4.2_05
@set RUN=%JAVA_HOME%\bin\java.exe -Xms32m -Xmx128m -classpath .;myapp.jar pack.app.Main -connection jdbc:oracle:thin:@10.0.0.1:1521:ABC -webroot http://10.0.0.2:8080/test
%RUN%
The jnlp file I use to start the same application is:
<jnlp codebase="http://10.0.0.2:8080/test/app">
<information>
</information>
<security>
<all-permissions/>
</security>
<resources>
<j2se version="1.4+"/>
<jar href="myapp.jar"/>
</resources>
<application-desc main-class="pack.app.Main ">
<argument>-codebase</argument>
<argument>http://10.0.0.2:8080/test/app</argument>
<argument>-webroot</argument>
<argument>http://10.0.0.2:8080/test</argument>
<argument>-dbrpc</argument>
</application-desc>
</jnlp>
I encountered two problems:
1. The aplication hangs when I click certain buttons, which is not the case when I run it normally from the batch file.
2. Some buttons do not even appear, where they appear normally using the batch file.
I would appreciate any hints that could help.
SamarYou could make a self extracting EXE with WinZip, and then do something like.. (You would create an application with source files to do this, with the below code being your 'install.bat')
@echo off
xcopy "AppFiles.exe" %WINDIR%\Temp
%WINDIR%\Temp\AppFiles.exe
%WINDIR%\Temp\AppFiles\Install.exe
RMDIR /S /Q %WINDIR%\Temp\AppFiles
If you monitor the install and your satisfied its working correctly, you can modify the success return codes under the 'Option' tab, or just check the box 'Continue on Error' to keep the build rolling after this install is complete. Additionally, you
may find this works better as VBS script. -
This magazine is just a simple PDF replica of our print magazine but I want to the URLs linked when I am viewing it on the iPad and Android devices. Is this possible?
So I just checked. All that script does is place PDFs into InDesign files. InDesign treats PDFs as static artwork so my answer stands.
You’ll have to open the individual InDesign files and add the hyperlinks. -
Two questions: Executing batch files and executing a JAR on boot-up.
I'm working with Windows XP and and currently I'm having a friend test this on Vista as well. I can't seem to find how to execute a batch file using Runtime.exec(). So far I've been passing the absolute pathname of the batch file as the argument to exec(), but it doens't seem to run, so I'm assuming there's another way.
Second question, how do I get a JAR file to start running whenever the user turns on the PC?
Thanks.I'm working with Windows XP and and currently I'm
having a friend test this on Vista as well. I can't
seem to find how to execute a batch file using
Runtime.exec(). So far I've been passing the
absolute pathname of the batch file as the argument
to exec(), but it doens't seem to run, so I'm
assuming there's another way.Are you using just Runtime.exec() or have you tried Runtime.getRuntime().exec()? If not, try that and see what happens.
Second question, how do I get a JAR file to start
running whenever the user turns on the PC?As far as I know, you can't do that programatically. You have to edit settings on your computer but I am not entirely sure.
Thanks. -
How do I start a batch file and check it's status?
First of all I want to say I am a beginner in Java.
I am working on an server side application that starts batch files (for database filling). After it starts the batch (.bat) file it has to check the status and write it in the database.
The problem I run into the combination of starting the batch and checking the status.
So far I have found out that I can run the batch file with starting up an process with the Runtime.getRuntime().exec command. What I haven't found out if it is posible to check the status of this proces in any way.
I also found out that with using thread commands like isAlive I can check the status of a thread, but not of an process. And I understand that a thread can't start an batch file.
So could anyone please help me on my way. Am I doing something wrong? Is any of the above info incorrect? Or am I on the right way? And if I am on the right way what is the next step? Thanx in advance.The problem I run into the combination of starting
the batch and checking the status.The exit status is only set onve the process completes.
process.exitStatus()
I also found out that with using thread commands like
isAlive I can check the status of a thread, but not
of an process. And I understand that a thread can't
start an batch file.Everything run in java is run from a thread. Only threads can do anything. The default thread is called "main" -
Batch file, and installing a executable​.
I'm pretty new to LabVIEW. Anyways, I need to create a makefile that will install the LabVIEW runtime engine, and several LabVIEW user created executable VIs into specific directories determined by environmental variables within the makefile. I've been looking around, and all I can find is batch file stuff. Any ideas would be appreciated. Thanks.
In short, I need LabVIEW RTE, and several labVIEW created executables installed on target machine via a makefile.
SebastianTodd has pointed you in the correct direction.
I tested this with an LV2009 installer that does not contain the LVRTE. I do not use make files (not a C coder) but think they may run applications like a batch file (if not, use a batch file).
1. Create the installer for your LV app and point the top level to install in single generic folder (c:\temp).
2. Include the other executables you mentioned as line items.
3. Run the installer locally to generate a installation spec file: 'setup.exe /generatespecfile myspec.ini'
(The only question I noted was about the install folder which I set to #INSTALL_FOLDER#)
4. Open the generated 'myspec.ini' file and find the 'set install directories' area and you should find:
<RootDirectory1>=#INSTALL_FOLDER#.
5. For my confirmation test, I changed this to 'c:\testInstall'.
6. Run the installer using the updated spec file (add the later parts for auto install; for silent, use just /q):
'setup.exe myspec.ini /qb /acceptlicenses yes'
From your makefile (or batch file), you should be able to update the #INSTALL_FOLDER# string in the intermediate spec file (myspec.ini) to the contents of the environment variable you want by simple string replacement then run the installer as shown in (6).
good luck -
Brain freeze with batch file and jar
My batch file located in the startup folder.
@ECHO ON
Set Path =C:\Program Files\My-App\jre\bin
cd C:\Program Files\My-App
javaw -cp C:\Program Files\My-App\Startup.jar; SrvcUtilTest
EXITthe error I get is "Could Not Find Main Class. Program will exit"
If I take the Set Path line out it works fine, but my customers will not have the JRE installed on their systems,so I set the path to the jre included with my app..
What am I missing or forgeting to do.
What am I missingNevermind, fixed it.
Moved the jar into the startup folder, added a manifest file and changed this line
javaw -cp C:\Program Files\My-App\Startup.jar; SrvcUtilTest
to
javaw -jar Startup.jar
Works now
Maybe you are looking for
-
Facebook and other websites not loading properly in Firefox (Solution)
This is for anyone who has had issues loading Facebook, eBay, twitter or any other site which shows plain text pushed to the left hand-side of the screen and fails to load images. This issue had me stumped for about 3 hours. No matter what I did. No
-
Music bought from iTunes store transfer to apple loos less format
Can I have all my music bought on iTunes store to be transfer in Apple loos less format and how I proceed?
-
Playing itunes purchased music in my car
I have an older car 2003 and want to burn songs I purchased on itunes to a cd so I can play them in my car. If I burn an "audio cd" will it work? If not, any suggestions? Also, I read that I can only burn a playlist 7 times. If I have one song on mul
-
Hi, I register a listener on a tree in LDAP (Netscape Directory Server) and then go ahead and modify one of the entries and that fires a NamingEvent to the listeners. Now when the objectChanged() callback method() on the listener is invoked, I print
-
Volume control is missing from task bar windows 7
I have tried all tips and tricks but that is not at all helping. My version of windows is genuine.