Docfxit Posted October 25, 2014 Share Posted October 25, 2014 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 Link to comment Share on other sites More sharing options...
Spider001 Posted October 25, 2014 Share Posted October 25, 2014 (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 October 25, 2014 by Spider001 Link to comment Share on other sites More sharing options...
Docfxit Posted October 25, 2014 Author Share Posted October 25, 2014 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 Link to comment Share on other sites More sharing options...
Docfxit Posted October 25, 2014 Author Share Posted October 25, 2014 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 Link to comment Share on other sites More sharing options...
Spider001 Posted October 25, 2014 Share Posted October 25, 2014 Run(@ComSpec & ' /c ' & '"C:\Program Files\Client Access\Emulator\Private\StartAllSessions.bch"', '"C:\Program Files\Client Access\Emulator\Private"', @SW_MAXIMIZE) Link to comment Share on other sites More sharing options...
Docfxit Posted October 25, 2014 Author Share Posted October 25, 2014 Thanks for the reply... That didn't run ether. Docfxit Link to comment Share on other sites More sharing options...
Spider001 Posted October 25, 2014 Share Posted October 25, 2014 try to change @comspec to 'cmd.exe' and give the error you get pl Link to comment Share on other sites More sharing options...
jguinch Posted October 25, 2014 Share Posted October 25, 2014 Did you try with ShellExecute ? Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
Docfxit Posted October 26, 2014 Author Share Posted October 26, 2014 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 Link to comment Share on other sites More sharing options...
Docfxit Posted October 26, 2014 Author Share Posted October 26, 2014 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: Thanks for the suggestion. There has to be a way to accomplish this. Docfxit Link to comment Share on other sites More sharing options...
Spider001 Posted October 26, 2014 Share Posted October 26, 2014 are you sure you want to run a bch extension Link to comment Share on other sites More sharing options...
Exit Posted October 26, 2014 Share Posted October 26, 2014 change /c to /k to see the error. /k means: keep the command window open. App: Au3toCmd UDF: _SingleScript() Link to comment Share on other sites More sharing options...
BrewManNH Posted October 26, 2014 Share Posted October 26, 2014 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 GudeHow 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 Link to comment Share on other sites More sharing options...
Docfxit Posted October 26, 2014 Author Share Posted October 26, 2014 are you sure you want to run a bch extension Defiantly. It has to be for it to run correctly. Thanks, Docfxit Link to comment Share on other sites More sharing options...
Docfxit Posted October 26, 2014 Author Share Posted October 26, 2014 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 Link to comment Share on other sites More sharing options...
Docfxit Posted October 26, 2014 Author Share Posted October 26, 2014 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 Link to comment Share on other sites More sharing options...
BrewManNH Posted October 27, 2014 Share Posted October 27, 2014 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 GudeHow 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 Link to comment Share on other sites More sharing options...
Docfxit Posted October 27, 2014 Author Share Posted October 27, 2014 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 Link to comment Share on other sites More sharing options...
BrewManNH Posted October 27, 2014 Share Posted October 27, 2014 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 GudeHow 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 Link to comment Share on other sites More sharing options...
Spider001 Posted October 27, 2014 Share Posted October 27, 2014 (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 October 29, 2014 by Melba23 Added tags Link to comment Share on other sites More sharing options...
Recommended Posts