Page 1 of 1

Waht is Wrong In Config.exe ??

Posted: Thu Nov 29, 2007 6:05 pm
by javieron
Hello , I habe a problem when I try to use COnfig.exe.

This is the code of my PowerBuilder Program

run('C:\config.exe /C')
run('C:\config.exe /S OUTPUT "C:\a.pdf"')
run('C:\config.exe /S ShowSaveAS never')
run('C:\config.exe /S ShowSettings never')
run('C:\config.exe /S ShowPDF no')
run('c:\config.exe /S ConfirmOverwrite yes')
run('c:\config.exe /S OwnerPassword a')
run('c:\config.exe /S UserPassword b')

Config.exe dont work fine , dont create Pdf in the Output route.

What is Wrong ?

Posted: Fri Dec 07, 2007 8:30 am
by jr
I have tried to make a simple .bat file that does the same as your example.

SET CONFIG=C:\Program Files\Bullzip\PDF Printer\API\EXE\config.exe
"%CONFIG%" /C
"%CONFIG%" /S OUTPUT "C:\temp\a.pdf"
"%CONFIG%" /S ShowSaveAS never
"%CONFIG%" /S ShowSettings never
"%CONFIG%" /S ShowPDF no
"%CONFIG%" /S ConfirmOverwrite yes
"%CONFIG%" /S OwnerPassword a
"%CONFIG%" /S UserPassword b

As you can see I changed the output path because the job doesn't have write access to the root of the C drive on my system. This batch file runs without any problems on my system. You can try to use it to debug your problem. Please make sure that you have sufficient rights in the destination folder.

Regards,
Jacob

Posted: Fri Dec 14, 2007 12:04 pm
by javieron
Ok , withs .bat file rules fine .

I discover what is wrong in mi program , the problem is time question if use sleep after run config.exe writes ok.

If I do :

run('C:\config.exe /S OUTPUT "C:\a.pdf"')
sleep(1)
run('C:\config.exe /S ShowSaveAS never')
sleep(1)
run('C:\config.exe /S ShowSettings never')
sleep(1)
run('C:\config.exe /S ShowPDF no')
sleep(1)
run('c:\config.exe /S ConfirmOverwrite yes')
sleep(1)
run('c:\config.exe /S OwnerPassword a')
sleep(1)
run('c:\config.exe /S UserPassword b')
sleep(1)

Thanks for all ;)

Posted: Sat Dec 15, 2007 11:23 am
by jr
You are right. It's the timing that is the problem. I just did some basic research on the function that you use to start another application. You are using the Run command of PowerScript, which is the scripting language of PowerBuilder by Sybase.

http://manuals.sybase.com/onlinebooks/g ... __BookView

When I look in the reference at the link above there is nothing in the description of the Run command that tells me it it will pause the script execution until the external program has terminated. If it doesn't wait you will end up starting multiple instances of the config.exe program trying to access the same settings.ini or runonce.ini file. This will lead to a resulting ini file where some of the entries are missing.

Best Regards,
Jacob