Sign in to follow this  
Followers 0
Docfxit

System i Access

29 posts in this topic

I am trying to get IBM System i Access to run.  This script doesn't run for some reason.

If Not ProcessExists("pcsws.exe") Then  ;Check if Client Access is running
    Run(@ComSpec & " /c" & "C:\Program Files\Client Access\Emulator\Private\StartAllSessions.bch", "C:\Program Files\Client Access\Emulator\Private", @SW_MAXIMIZE)
EndIf

Does anyone see why it might not run?

Thanks,

Docfxit

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

yours

Run(@ComSpec & " /c" & "C:\Program Files\Client Access\Emulator\Private\StartAllSessions.bch", "C:\Program Files\Client Access\Emulator\Private", @SW_MAXIMIZE)

solved i think

Run(@ComSpec & " /c " & ""C:\Program Files\Client Access\Emulator\Private\StartAllSessions.bch"", ""C:\Program Files\Client Access\Emulator\Private"", @SW_MAXIMIZE)

and maybe .bch to .bat that i don't now

Edited by Spider001

Share this post


Link to post
Share on other sites

Thanks for the reply...

When I try to run it I get this error:

C:\Dnload\StartClientAccess.au3 (2) : ==> Unable to parse line.:
Run(@ComSpec & " /c " & ""C:\Program Files\Client Access\Emulator\Private\StartAllSessions.bch"", ""C:\Program Files\Client Access\Emulator\Private"", @SW_MAXIMIZE)
Run(@ComSpec & " /c " & ""C:^ ERROR

Share this post


Link to post
Share on other sites

I tried this:

Run(@ComSpec & " /c " & "'C:\Program Files\Client Access\Emulator\Private\StartAllSessions.bch'", "'C:\Program Files\Client Access\Emulator\Private'", @SW_MAXIMIZE)

It didn't give me any errors, but it also didn't run.

I also tried this:

Run("C:\Program Files\Client Access\Emulator\Private\StartAllSessions.bch", "C:\Program Files\Client Access\Emulator\Private", @SW_MAXIMIZE)

It doesn't run either.

Thanks,

Docfxit

Share this post


Link to post
Share on other sites

Run(@ComSpec & ' /c ' & '"C:\Program Files\Client Access\Emulator\Private\StartAllSessions.bch"', '"C:\Program Files\Client Access\Emulator\Private"', @SW_MAXIMIZE)

Share this post


Link to post
Share on other sites

Thanks for the reply...

That didn't run ether.

Docfxit

Share this post


Link to post
Share on other sites

try to change @comspec to 'cmd.exe'

and give the error you get pl

Share this post


Link to post
Share on other sites

try to change @comspec to 'cmd.exe'

and give the error you get pl

 

This is the error I get:

"C:\Dnload\StartClientAccess.au3" (6) : ==> Unknown function name.:
Run(cmd.exe & ' /c ' & '"C:\Program Files\Client Access\Emulator\Private\StartAllSessions.bch"', '"C:\Program Files\Client Access\Emulator\Private"', @SW_MAXIMIZE)
Run(^ ERROR

Share this post


Link to post
Share on other sites

Did you try with ShellExecute ?

 

I tried this:

ShellExecute('"C:\Program Files\Client Access\Emulator\Private\StartAllSessions.bch"', "" ,'"C:\Program Files\Client Access\Emulator\Private"', @SW_MAXIMIZE)

This is the error I get:

ShellExecute.jpg

Thanks for the suggestion.

There has to be a way to accomplish this.

Docfxit

Share this post


Link to post
Share on other sites

are you sure you want to run  a bch extension

Share this post


Link to post
Share on other sites

change /c to /k to see the error.

/k means: keep the command window open.


My UDFs, Abbrevs and Snippets
If you like my post, just click the like button :) 

Share this post


Link to post
Share on other sites

If you're on a 64 bit OS, make sure your script is being run as a 64 bit process, otherwise it's trying to find the .bch file in C:Program Files (x86) and not C:Program Files.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

are you sure you want to run  a bch extension

Defiantly.   It has to be for it to run correctly.

Thanks,

Docfxit

Share this post


Link to post
Share on other sites

change /c to /k to see the error.

/k means: keep the command window open.

After changing it to /k, no cmd window stays open.  I tested it with cmd.exe and @comspec.

Thanks,

Docfxit

Share this post


Link to post
Share on other sites

If you're on a 64 bit OS, make sure your script is being run as a 64 bit process, otherwise it's trying to find the .bch file in C:Program Files (x86) and not C:Program Files.

 

I'm running it inside SciTE.  I don't know how to make sure it's running as a 64 bit process.

Thanks,

Docfxit

Share this post


Link to post
Share on other sites

If the .bch file is normally run by another program, shouldn't you be running that program and sending the bch file and path to IT as a parameter of the program, rather than trying to run the .bch file directly?


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

If the .bch file is normally run by another program, shouldn't you be running that program and sending the bch file and path to IT as a parameter of the program, rather than trying to run the .bch file directly?

 

I normally run the .bch from the desktop.

Thanks,

Docfxit

Share this post


Link to post
Share on other sites

That's not an answer, it is being executed by another program, you should try running that program and send the bch file as a parameter to it.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

#20 ·  Posted (edited)

run that and upload txt file pl

#include <array.au3>
#include <file.au3>

Local $aArray = _FileListToArrayRec('c:\Program Files', "*", $FLTAR_FOLDERS,$FLTAR_RECUR,$FLTAR_NOSORT,$FLTAR_FULLPATH)
$aArray &= _FileListToArrayRec('c:\Program Files (x86)', "*", $FLTAR_FOLDERS,$FLTAR_RECUR,$FLTAR_NOSORT,$FLTAR_FULLPATH)
_FileWriteFromArray(@ScriptDir & '\dirs.txt', $aArray)
Edited by Melba23
Added tags

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0