Jump to content

Recommended Posts

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
Posted

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
Posted

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

Posted

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
Posted

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

Posted

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

Posted

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

Posted

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

Posted

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

Posted

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

Posted

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

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
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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