Exit Operation Issue with v9.4
Jim Stephenson
I have an old app in eDev 9.4 that has been running just fine.
I needed to make a change in the way I am importing some txt files into this app so brought it back to my computer to make the changes. For my 9,4 apps that I am still maintaining I am using v9.4 sp8. The client is actually running v9.4 sp7. So, I make my changes and everything looks good. When I run the task to import the text files I am doing an Exit operation and running a bat file that opens an ftp site and copies some files to a local folder. Running the bat file by itself works just fine from a command prompt. But when I run it from v9.4sp8 it tells me it cannot find the bat file. So, I copy the clients v9.4sp7 folder to my computer, setup a shortcut to run the program using the same INI as I am using with v9.4sp8 and run the task. It works just fine. What could be different between these two versions that would cause the newer one to not find the 'bat' file while the older one finds it just fine and they are both using the same INI and the same control file? I have tried moving the 'bat' file into a local folder under v9.4sp8 and it doesn't make any difference. Any ideas?
|
||||||||||||||
|
||||||||||||||
Jim,
Make sure you are defining the full path to your batch file and that it is enclosed in double quotes at the beginning and also at the end Exmaple: "C:\My Path\Batchfile.bat"
|
||||||||||||||
|
||||||||||||||
Jim Stephenson
Alex, It has the full path and double quotes don't make a difference (I already tried that). Jim
On Tue, Jun 7, 2022 at 12:39 PM Alex Medvedovski <alex@...> wrote: Jim,
|
||||||||||||||
|
||||||||||||||
sherman levine
CommandProcessor entry correct?
Try just ctrl+Z and see if that opens
an OS window
Sherm
On 6/7/2022 3:58 PM, Jim Stephenson
wrote:
|
||||||||||||||
|
||||||||||||||
Jim Stephenson
Yep, that works. It brings up a command window. But it still can't find the bat file when I run the program.. The thing that really confuses me is that the same INI and Control file that works just fine in sp7.
On Tue, Jun 7, 2022 at 2:26 PM sherman levine <sherman.levine@...> wrote:
|
||||||||||||||
|
||||||||||||||
sherman levine
Can you execute the .BAT from the
Ctrl+Z window?
Might the .BAT reference a program/file
which exists in your sp7 folder but not in your sp8 folder?
On 6/7/2022 5:08 PM, Jim Stephenson
wrote:
|
||||||||||||||
|
||||||||||||||
Wes Hein
Does the newer version have permissions to write the batch file where you want it?
|
||||||||||||||
|
||||||||||||||
Jim Stephenson
I can ctrl-z and then paste the exit operation I am using ("M:\MAGIC9\INDMEAT\EXPORT\NEWDOWNLOAD.BAT") and it runs just fine. Both sp7 and sp8 run the exact same operation.
On Tue, Jun 7, 2022 at 3:09 PM sherman levine <sherman.levine@...> wrote:
|
||||||||||||||
|
||||||||||||||
sherman levine
I'm out of ideas :-(
On 6/7/2022 5:33 PM, Jim Stephenson
wrote:
|
||||||||||||||
|
||||||||||||||
Jim Stephenson
Me too.
On Tue, Jun 7, 2022 at 4:00 PM sherman levine <sherman.levine@...> wrote:
|
||||||||||||||
|
||||||||||||||
Stephen Saxton
Hi Jim
I had a similar issue on an older client.
quick question... is your licence.dat in the same folder as your Magic 9.4 install?
if so, this is what I did to make my batch files start working again... (it also verified which folder I was using for my Magic.)(with several versions, sometimes I get lost in the shuffle)
INIGet ('[MAGIC_ENV]LicenseFile')
used that to get my magic directory
put my batch files in this found directory
parse out the path before my licence.dat (or whatever it is called)
use this parsed out path in my EXIT path to the batch files.
hope this helps..
Steve Saxton
-----Original Message-----
From: Jim Stephenson <jstephen@...> To: main@magicu-l.groups.io Sent: Tue, Jun 7, 2022 6:05 pm Subject: Re: [magicu-l] Exit Operation Issue with v9.4 Me too.
On Tue, Jun 7, 2022 at 4:00 PM sherman levine <sherman.levine@...> wrote:
|
||||||||||||||
|
||||||||||||||
sherman levine
Is m local? If not perhaps use \\servername\path\… Same if you’re using SUBST Sherm Sherm
On Jun 7, 2022, at 18:04, Jim Stephenson <jstephen@...> wrote:
|
||||||||||||||
|
||||||||||||||
Dave Beckinsale
Hi Jim,
I've just tested an old program with an exit operation in SP8c and get the same result as you, file not found. However if I toggle wait on the exit operation to No, the file is found and it runs. I had to put a pause in the exit operation for it to stay on screen though, not sure if this helps. In SP7a it runs ok with wait=Yes best regards Dave.
|
||||||||||||||
|
||||||||||||||
De Netwerkadviseur BV
Hi Jim and Dave,
Are you using a Windows 11 version? I remember something simular with .bat executing from Exit command with Windows 11. Works fine with Windows 10. If you can confirm, I will look into my app to see the solution I had. Kind regards, André
|
||||||||||||||
|
||||||||||||||
Jim Stephenson
Dave, that is strange it works by changing it to Wait: No. I really don't like the idea of having to put a pause in the task though. The idea with this task is to start it and walk away. Andre, this is on Windows 11.
On Wed, Jun 8, 2022 at 4:51 AM De Netwerkadviseur BV <andre@...> wrote: Hi Jim and Dave,
|
||||||||||||||
|
||||||||||||||
Dave Beckinsale
Jim and Andre
It does appear to be an issue with SP8 as I'm running 9.4 on Win81. One thing i have noticed is if I call cmd.exe it's ok, so i tried to following line and it appears to work 'cmd.exe /k filename.bat' not tested under Win11 but perhaps this will work for you Jim. best regards Dave
|
||||||||||||||
|
||||||||||||||
De Netwerkadviseur BV
Hi Dave and Jim,
I build an Exe to solve the problem: == using System; using System.Diagnostics;
namespace ExecBatch
{
class Program
{
static void Main(string[] args)
{
if (args.Length != 1)
{
Console.WriteLine("Use ExecBatch <path_batchfile>");
Console.ReadKey();
}
else
{
var processInfo = new ProcessStartInfo("cmd.exe", "/c " + args[0]);
processInfo.CreateNoWindow = true;
processInfo.UseShellExecute = false;
processInfo.RedirectStandardError = true;
processInfo.RedirectStandardOutput = true;
var process = Process.Start(processInfo);
process.WaitForExit();
process.Close();
}
}
}
}
==I think the method of Dave should work for you. Kind regards, André
|
||||||||||||||
|
||||||||||||||
Jim Stephenson
How are you calling that exe Andre?
On Wed, Jun 8, 2022 at 9:57 AM De Netwerkadviseur BV <andre@...> wrote: Hi Dave and Jim,
|
||||||||||||||
|
||||||||||||||
Jim Stephenson
Nevermind Andre. I see what you are doing.
On Wed, Jun 8, 2022 at 10:44 AM James Stephenson <jstephen@...> wrote:
|
||||||||||||||
|
||||||||||||||
Jim Stephenson
That works Dave.
On Wed, Jun 8, 2022 at 9:31 AM Dave Beckinsale <david@...> wrote: Jim and Andre
|
||||||||||||||
|