Jump to content

Working fine from command line but not as "subprogram"


 Share

Recommended Posts

Hi,

I have an AutoIt script that is reading and analysing a text file and then create a PDF of it (with a third party library). This script (.exe / it is compiled) is working fine if I start it in a DOS Box or from the desktop.

If I start this script from inside another AutoIt script (I would call this a "subprogram"), I get other results in my PDF. How is that possible?

Here is the command to start the script from inside the "main" AutoIt script:

ShellExecuteWait($MyBin & "\PDFcreate.exe", "-I -P -AUTO", $PDFPrint & "\", "open", @SW_HIDE)

Is it possible that the calling script can influence the called script?

Regards

Dolphins

Link to comment
Share on other sites

What do you mean by "I get other results"? Do you get an empty PDF, no PDF at all or an unexpected content?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

You could try to run ShellExecuteWait without the @SW_HIDE flag so you can see if there are any error messages.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Command line from DOS Box is this:

c:binpdfcreate.exe -I -P -AUTO

So in this command I don't set the working directory. But if I paste this into a desktop link and set the working directory, there is no difference in the result compared to the DOS Box.

The name of the files to read come from a text file (that name is defined in a config file). So I don't need to give the name of the input files in the command line, they come from that text file.

Link to comment
Share on other sites

dolphins,

I see...nice problem. You are going to need to identify some pattern to the difference, or see if there is an error anywhere (as water suggested).

Good Luck and keep us posted!

kylomas

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Link to comment
Share on other sites

unexpected content

basically 99% is ok ... but about 1% of the info in the PDF is wrong

Can you post a screenshot of a PDF that is OK versus one in error? Maybe it's an ANSI/ASCII or a code page problem. Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...