Run Program not running

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Run Program not running

Post by Bob Hansen » Thu Apr 14, 2005 4:12 am

I have some new scripts that have been failing intermittently. Basically one line, Run Program>after all checks for source/destination existence, etc. are done.. Being run in Win98 and XP PRO environments, with same type of failure.

Just doing a basic XXCopy backup copying all of Drive C to a Shared Drive "R/S/T/U/V" across the network. Each day the destination drive changes, using hard drives vs. tapes for Mon-Fri backups. The problem is not limited to any of the destination drives. All the destination drives are on the same server box. But this seems to be a Run Program> issue, not XXCOPY. If I copy/paste from the Macro Scheduler log into the Command window, the command runs with no problem.

Example of line that does not run:

Code: Select all

Run Program>command.com /c xxcopy C:\*.* T:\Holter /EXC:\Data\Backups\Xxcopy\ExcludeList.txt /backup /CK0 /FF /PB >> C:\Data\Backups\Logs\20050413.log
The XP PRO line uses cmd vs. command.com.

Scheduled to run at night unattended. They trigger OK, but intermittently come back with an error message box that says "Had trouble running ".... the full string shows up here....."
I have been able to eliminate the error by removing the output that is redirected to the text file. If I drop >>....... I don't get the error. Is there some length limitation for Run Program that I don't know about? Could it be the result of a circular problem because trying to do a backup that includes the destination location in the redirected report?

Some days the scripts run OK, sometimes they come up with the error message. Cannot predict when they will run. I guess I could break up the command line into a couple of variables and send them instead.

Another option is probably to use UNC vs. Mapped Drive Letters.

But I want to understand the problem befote I implement a solution. What is wrong?
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

User avatar
JRL
Automation Wizard
Posts: 3501
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Thu Apr 14, 2005 2:42 pm

Bob,
You might try putting the offending line in a batch file, calling the batch file with "Run Program" and checking to see if you still have the problem. If the problem disappears, I might suspect a Macro Scheduler problem. If the problem persists, I would then suspect a problem with "xxcopy".

I'm not familiar with xxcopy. Where does the program come from? Is it available to the public? It must be useful or you wouldn't be using it.

Hope this was helpful,
Dick

User avatar
JRL
Automation Wizard
Posts: 3501
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Thu Apr 14, 2005 3:18 pm

Did a search and found your post regarding xxcopy.

http://www.mjtnet.com/usergroup/viewtop ... ght=xxcopy

Thanks,
Dick

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Fri Apr 15, 2005 3:00 pm

Hello JRL - thanks for your suggestion on batch files. I created and ran batch files last night, and had no failures on 5 different machines. I will monitor for a few more nights.

I would prefer not to use batch files because of additional distribution problems. I guess I could create the batch file dynamically from within Macro Scheduler, then delete it when done, but I should not have to do that.

I think that running Run Program> should be working wihout going through these extra steps. Hoping that Marcus will have some insight on this. Full command string runs OK in batch file, runs OK from Start/Run, runs OK from Command Prompt window. Does not ALWAYS run OK from Run Program>. Fails over 50% of attempts.

This sample line:

Code: Select all

Run Program>command.com /c xxcopy %Source% %Destination% %ExcludeList% %Switches% >> %LogFile%
that translates to:

Code: Select all

Run Program>command.com /c xxcopy C:\*.* T:\Holter /EXC:\Data\Backups\Xxcopy\ExcludeList.txt /backup /CK0 /FF /PB >> C:\Data\Backups\Logs\20050413.log
is the line that fails.
This translated line is what is tried in Run/Batch/Dos tests successfully.
This translated line that fails is what is in the message box that says "Had trouble running (translated line)"
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Sat Apr 16, 2005 4:01 pm

Run Program>batchfile.bat ran OK on five systems last night. After running them, I tried original status again on one of them. I copied the single batch file line back into Macro Scheduler, entered it onto the Run Program> line again, vs. the batch file, and got error message again.

The line has been modifed to eliminate the redirection and now uses xxcopy switch to do the logging. Same result, runs OK in batch file, from Start/Run and in the DOS window. But running from Run Program>results in error message.

Code: Select all

Run Program>command.com /c xxcopy C:\*.* V:\Holter /EXC:\Data\Backups\Xxcopy\ExcludeList.txt /backup /CK0 /FF /PB /oAC:\Data\Backups\Logs\20050415Msg.log /oFC:\Data\Backups\Logs\20050415File.log
(167 characters, original was 123 characters long)

This looks reproduceable on any machine. I just put that single line into MacroScheduler on another computer, ignoring the Drive letters, xxcopy command, etc. to see results. Same error message.
Image

There is a real problem here looking for a solution. :roll:
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Sat Apr 16, 2005 5:14 pm

I did some more testing, eliminating each parameter from the right. I found that if I eliminate both of the /o switches (/oA, /oF) that the error message did not appear, and xxcopy tries to run. These /o switches are used to create log files collecting information from xxcopy.

In my first posting I noted that if I eliminated the redirection, that the command line worked OK. There seems to be some consistency here. It appears that if the Run Program command includes redirections that there may be some issues.

But that also seems inconsistent because I know I have been using redirection on Run Program command lines for many years.

I don't know the answer, just looking for clues. And again, this does not appear to be an xxcopy problem because the error seems to come up before the command line is even passed to xxcopy.

More testing: Removed all parameters in middle, only keeping the /o switches (120 chars):

Code: Select all

Run Program>command.com /c xxcopy C:\*.* V:\Holter  /oAC:\Data\Backups\Logs\20050415Msg.log /oFC:\Data\Backups\Logs\20050415File.log
GOOD-No error message, xxcopy tries to run. Looking more link a problem with the length of the Run Program line.

Next tests:
Reinserted /EX parameter (161 chars):

Code: Select all

Run Program>command.com /c xxcopy C:\*.* V:\Holter /EXC:\Data\Backups\Xxcopy\ExcludeList.txt /oAC:\Data\Backups\Logs\20050415Msg.log /oFC:\Data\Backups\Logs\20050415File.log
NG-Error message.

Removed /EX, added all others (140 chars):

Code: Select all

Run Program>command.com /c xxcopy C:\*.* V:\Holter /oAC:\Data\Backups\Logs\20050415Msg.log /oFC:\Data\Backups\Logs\20050415File.log /backup /CK0 /FF /PB
NG-Error message.

Removed /PB (136 chars):

Code: Select all

Run Program>command.com /c xxcopy C:\*.* V:\Holter /oAC:\Data\Backups\Logs\20050415Msg.log /oFC:\Data\Backups\Logs\20050415File.log /backup /CK0 /FF
GOOD, no error

Changed /FF to /PB (136 chars):

Code: Select all

Run Program>command.com /c xxcopy C:\*.* V:\Holter /oAC:\Data\Backups\Logs\20050415Msg.log /oFC:\Data\Backups\Logs\20050415File.log /backup /CK0 /PB
GOOD, no error, so it is not /PB value string,

Added /FF back on (140 chars):

Code: Select all

Run Program>command.com /c xxcopy C:\*.* V:\Holter /oAC:\Data\Backups\Logs\20050415Msg.log /oFC:\Data\Backups\Logs\20050415File.log /backup /CK0 /PB /FF
NG-error message.

So it now appears to me that there may be a length limit between 136 and 140 characters.

More testing:
Removed characters one at a time from file name "20050415File.log", and found that length of 138 characters was good, length of 139 characters fails.

Note that all character counts include command.com, everything after the ">" delimiter. This does not appear to be a system limit since the lines run OK in other execute methods. And the original length in Macro Scheduler is shorter because it is actually made up of variables. The strings tested here are the end result to be passed to the OS.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Sun Apr 17, 2005 3:55 am

This is probably a dumb question, but I'm trying to learn from a master...

What's the advantage of using "Run Program>command.com xxcopy etc" over just "Run Program>xxcopy etc" ?

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Sun Apr 17, 2005 5:42 am

Great question me_again! Forcing me to think!

It shows that habit is stronger than logic. It looks like command/cmd may not be needed here. I have been using Xxopy for many years, since it came out in DOS. And since it is a command line program with no GUI, I have just continued to think of it as an old 16 bit utility that probably needed the Command window.

I still run some DOS applications that need command/cmd to close properly or else I need to make batch files, pif, lnks, wsf files, etc. So I have developed a habit of always using command/cmd for many programs that probably don't need it.

Some older programs will be full screen if I don't use command/cmd. When I use command/cmd then they will run in a window. Don't always know what the result will be so I got in the habit of always using it. And I probably won't break that habit very easily.

And, as you probably found out, it looks like I don't get that error when I drop the commmand/cmd portion from Run Program> with this particular script.

I don't have access to the real systems that use that command until next week, so I won't know if this turns out to be more reliable or not.

Thanks for asking about this, because you may have provided a work around, but I am still curious about a possible length limitation. Am curious to see what Marcus can lend to this discussion for me.

When you locate that master to learn from, send the name to me. I learn more every day from everyone.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Sun Apr 17, 2005 3:48 pm

I'm not familiar with xxcopy (looks useful, I will try it) but I do know that I can Run Program extremely long Image Magick command strings that won't run in a command window or batch.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts