|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
How do I make .bat files unreadable/uneditable? |
« View previous topic :: View next topic » |
Author |
Message
|
PeterPotkay |
Posted: Wed Apr 17, 2002 6:08 am Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
I am using support pak MA0H, a great little utility that lets you watch the depths of your queues in real time (no hitting refresh constantly).
I run it by configuring a bat file to hold the MQSERVER variable for the particular Queue Manager I want to connect to, as well as the queues I want to watch. I would like to give this app to one of my in house clients so they can monitor their development queues without constantly calling me up.
Problem is, watch q is pretty powerful. You can connect to any QM in our system, and then clear queues or put messages. So if I give them the app with the associated bat file configured just to run against their stuff, I dont want them to have the ability to start copying and editing that bat file.
Any ideas on how to create an unreadable/uneditable bat file that can still be executed and copied?
_________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
kolban |
Posted: Wed Apr 17, 2002 6:51 am Post subject: |
|
|
 Grand Master
Joined: 22 May 2001 Posts: 1072 Location: Fort Worth, TX, USA
|
If this is to run on windows, you could easily write a C program that calls the
"system()" system call which takes as a parameter the name and paramters of the program to run and starts it. I think if you use the "putenv()" system call, you could set the environment variable before calling system ...
something like:
Code: |
main(int argc, char argv[])
{
putenv("MQSERVER=xyz");
system("myprog -parm myparms");
}
|
|
|
Back to top |
|
 |
PeterPotkay |
Posted: Wed Apr 17, 2002 7:21 am Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
Don't know C. (Mainframe guy here)
I found an app on the web (http://download.com.com/3000-2229-9038029.html) that takes a bat file and compiles it into an .exe file, but it isn't supported on NT/2000. I'm gonna take my bat file home to my 98 pc, run the app there, and bring back the exe to see if it runs at work on the NT pc.
_________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
StefanSievert |
Posted: Wed Apr 17, 2002 8:58 am Post subject: |
|
|
 Partisan
Joined: 28 Oct 2001 Posts: 333 Location: San Francisco
|
Hi guys,
when I tried to do something like that in the days of NetBIOS MQClients, which needed the MQNAME (I think) variable to set the NetBIOS name for the client application, I ran into the problem that environment variables are picked up by the C runtime during program start. A putenv() call within the program was not honored by an application that was invoked from within the same program using the system() call.
So, if you are getting a 2059 on your compiled BAT file, this would be the first thing to think of as the possible cause.
I tried a lot of adventurous stuff at that time to get it to work; without success.
But you can probably workaround it by using a channel table file that you distribute with your compiled EXE. However, if the MQSERVER variable takes precedence of the MQCHLLIB/MQCHLTAB setting (which I don't know from the top of my head), an MQ aware user might always find a way around it.
Hope that helps,
Stefan |
|
Back to top |
|
 |
bower5932 |
Posted: Wed Apr 17, 2002 1:23 pm Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
Couldn't you also use the MQCONNX to set your client connection? I thought that the MQCNO structure was created so that you could pass in a pointer to a MQCD which could contain the information that you would have passed in via the MQServer environment variable. |
|
Back to top |
|
 |
mrlinux |
Posted: Thu Apr 18, 2002 4:10 am Post subject: |
|
|
 Grand Master
Joined: 14 Feb 2002 Posts: 1261 Location: Detroit,MI USA
|
There use to be a batch file compiler that would compile a batch file to an executable. I dont know where to find it, but I will ask one of our NT admins if
he knows where to get it.
_________________ Jeff
IBM Certified Developer MQSeries
IBM Certified Specialist MQSeries
IBM Certified Solutions Expert MQSeries |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|