Jump to content

Recommended Posts

Posted

Hi.

I'm trying to run autoit script on remote machine (with psexec from SysInternals\PCTools). Here is how I do it:

1. On local machine, I run the following code (local.bat):

psexec.exe \\remotecomp -u remoteuser -p password -i c:\windows\remote.bat

2. The content of remote.bat located on remote machine:

"C:\Program Files\AutoIt3\autoit3.exe" C:\work\remotetest.au3

3. The content of remotetest.au3:

run ('cmd /c "compmgmt.msc"', @SystemDir, @SW_HIDE)

4. When I run my local.bat, I get the following error on my remote machine:

---------------------------

Microsoft Visual C++ Runtime Library

---------------------------

Runtime Error!

Program:

This application has requested the Runtime to terminate it in an unusual way.

Please contact the application's support team for more information.

---------------------------

OK

---------------------------

5. If my remotetest.au3 contained only this code, it would work fine:

MsgBox(0, "Test", "Hello world!")

It means, something wrong with

run ('cmd /c "compmgmt.msc"', @SystemDir, @SW_HIDE)

Any suggestions? Thanks in advance,

Posted

2. The content of remote.bat located on remote machine:

"C:\Program Files\AutoIt3\autoit3.exe" C:\work\remotetest.au3
I maybe wrong here but I you need to compile the au3 file into an exe file. From there you should not have any problems running it as long as your code has no errors in it.

RUN . . . Slide . . . TAG . . . Your out . . . PAINTBALL !!!

Posted

I maybe wrong here but I you need to compile the au3 file into an exe file. From there you should not have any problems running it as long as your code has no errors in it.

Thanks for advice but it didn't help. I made it executable but I'm getting the same error...

Posted (edited)
Posted

I would read the help files about run, @ComSpec, and look at the examples they give. I was able to get it to work locally.

RUN . . . Slide . . . TAG . . . Your out . . . PAINTBALL !!!

Posted

Have you tried psexec to a different PC for experience comparison?

Lar.

Yes, I tried with the same result. Does it work in your environment? I mean, remote execution, not local one. Thanks.
Posted

What happens if you replace cmd with @Comspec?

you could also try @WindowsDir & "\system32\mmc.exe"

Thanks for advice. I tried the followin variants:

run (@COMSPEC & " /c" & 'compmgmt.msc', @SystemDir, @SW_HIDE)

and

run (@COMSPEC & " /c" &@WindowsDir & '\system32\mmc.exe', "", @SW_HIDE)

Same result. Did it work in your environment? I mean, remote execution, not local one.

Posted

I would read the help files about run, @ComSpec, and look at the examples they give. I was able to get it to work locally.

Yes, I have been reading it. No problem to work locally. The main point is specified in the topic: remote execution. Did it work in your environment? Thanks.

Posted

It should. I've never had such a problem.

run(@COMSPEC & " /c " & @WindowsDir & "\system32\mmc.exe compmgnt.msc", "", @SW_HIDE)
Thanks for feedback. It works locally, but not remotely. Actially, it is clear now the reason is out of AutoIT scope. If I run this code on local machine:

psexec.exe \\remotecomp -u remoteuser -p password -i c:\windows\remote.bat

and remote.bat contain this string:

mmc.exe

then I have Runtime Error specified in the beginning of this topic. The same error is when I use beyondexecv2.exe instead of psexec.exe.

That's it :)

Posted

Thanks for feedback. It works locally, but not remotely. Actially, it is clear now the reason is out of AutoIT scope. If I run this code on local machine:

psexec.exe \\remotecomp -u remoteuser -p password -i c:\windows\remote.bat

and remote.bat contain this string:

mmc.exe

then I have Runtime Error specified in the beginning of this topic. The same error is when I use beyondexecv2.exe instead of psexec.exe.

That's it :)

The problem disappeared when I got the last version of PsExec. Earlier, I used to work with older one (1.3).

PsExec v1.82

Thanks to all !

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
  • Recently Browsing   0 members

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