YoungRacoon Posted March 11, 2008 Share Posted March 11, 2008 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, Link to comment Share on other sites More sharing options...
LarryDalooza Posted March 11, 2008 Share Posted March 11, 2008 What type of remote system? OS? AutoIt has helped make me wealthy Link to comment Share on other sites More sharing options...
YoungRacoon Posted March 11, 2008 Author Share Posted March 11, 2008 What type of remote system? OS?Windows 2003 sp1. Link to comment Share on other sites More sharing options...
roofninja Posted March 11, 2008 Share Posted March 11, 2008 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 !!! Link to comment Share on other sites More sharing options...
YoungRacoon Posted March 11, 2008 Author Share Posted March 11, 2008 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... Link to comment Share on other sites More sharing options...
LarryDalooza Posted March 11, 2008 Share Posted March 11, 2008 Have you tried psexec to a different PC for experience comparison? Lar. AutoIt has helped make me wealthy Link to comment Share on other sites More sharing options...
spudw2k Posted March 11, 2008 Share Posted March 11, 2008 (edited) What happens if you replace cmd with @Comspec? you could also try @WindowsDir & "\system32\mmc.exe" Edited March 11, 2008 by spudw2k Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF  Link to comment Share on other sites More sharing options...
roofninja Posted March 11, 2008 Share Posted March 11, 2008 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 !!! Link to comment Share on other sites More sharing options...
YoungRacoon Posted March 12, 2008 Author Share Posted March 12, 2008 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. Link to comment Share on other sites More sharing options...
YoungRacoon Posted March 12, 2008 Author Share Posted March 12, 2008 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. Link to comment Share on other sites More sharing options...
YoungRacoon Posted March 12, 2008 Author Share Posted March 12, 2008 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. Link to comment Share on other sites More sharing options...
YoungRacoon Posted March 13, 2008 Author Share Posted March 13, 2008 Guys, am I the only one with this problem? Is it possible to use Run() in AutoIT scripts that are executed remotely? Link to comment Share on other sites More sharing options...
spudw2k Posted March 14, 2008 Share Posted March 14, 2008 (edited) It should. I've never had such a problem. run(@COMSPEC & " /c " & @WindowsDir & "\system32\mmc.exe compmgnt.msc", "", @SW_HIDE) Edited March 14, 2008 by spudw2k Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF  Link to comment Share on other sites More sharing options...
YoungRacoon Posted March 14, 2008 Author Share Posted March 14, 2008 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 Link to comment Share on other sites More sharing options...
YoungRacoon Posted March 19, 2008 Author Share Posted March 19, 2008 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 ! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now