Jump to content

Script on remote PC dialogs on my PC


Recommended Posts

I am using a script to loadtest a network and have used a Prgress bar function that I got from the scripts and scraps forum and very nice it is too.

But the problem I have is that even though I have compiled the file transfer script and moved it to the remote PC when I run it from a script on my PC using the network path to the exe the script appears to be running on my PC and the progress bar appears on my PC. This is annoying as I need to be running another script on my PC to perform further tests other the network.

How can I run the application from a script on my PC but have it running as if it was executed from the other PC eg dialog appearing on that PC and also the processor of that PC being used?

Do I need to use some sort of remote control software or do I have to Run the application as though I was a user on the remote PC?

Thanks

Link to comment
Share on other sites

I am using a script to loadtest a network  and have used a Prgress bar function that I got from the scripts and scraps forum and very nice it is too.

But the problem I have is that even though I have compiled the file transfer script and moved it to the remote PC when I run it from a script on my PC using the network path to the exe the script appears to be running on my PC and the progress bar appears on my PC. This is annoying as I need to be running another script on my PC to perform further tests other the network.

How can I run the application from a script on my PC but have it running as if it was executed from the other PC eg dialog appearing on that PC and also the processor of that PC being used?

Do I need to use some sort of remote control software or do I have to Run the application as though I was a user on the remote PC?

Thanks

<{POST_SNAPBACK}>

the way that i typically do this is i'll just have the script run on the remote pc via logon.bat... i have an 'updater' script that runs at logon on each pc, and it checks to see if there is anything in the update folder on a network share. if there is anything there, it downloads and executes...
Link to comment
Share on other sites

Well I have some progress I can now run my compiled script using PSExec but I am having a problem with the following

$sCS = FileFindFirstFile("\\Lee\Drive-c\Back\")

This gives 0 when run locally on \\Ben and the resulting code then works but when run from a script on my machine (\\Lee) with the following line and PSExec

Run ("C:\PSTools\PSExec.exe \\Ben -i C:\Filecopyloop.exe")

it gives -1.

Any clue as to why?

Lee is a user with admin rights on Bens PC.

Thanks

Link to comment
Share on other sites

Well I have some progress I can now run my compiled script using PSExec but I am having a problem with the following

$sCS = FileFindFirstFile("\\Lee\Drive-c\Back\")

This gives 0 when run locally on \\Ben and the resulting code then works but when run from a script on my machine (\\Lee) with the following line and PSExec

Run ("C:\PSTools\PSExec.exe \\Ben -i C:\Filecopyloop.exe")

it gives -1.

Any clue as to why?

Lee is a user with admin rights on Bens PC.

Thanks

<{POST_SNAPBACK}>

your best bet to get a good solution may be to post a full listing of the code...
Link to comment
Share on other sites

Ok here is some example code that demonstrates my problem

The following code is compiled as an exe and placed on \\Ben on the C drive

; Shows the filenames of all files in the current directory, note that "." and ".." are returned.
$search = FileFindFirstFile("\\Lee\Drive-c\BACK\*.*")  

; Check if the search was successful
If $search = -1 Then
    MsgBox(0, "Error", "No files/directories matched the search pattern")
    Exit
EndIf

While 1
    $file = FileFindNextFile($search) 
    If @error Then ExitLoop
    
    MsgBox(4096, "File:", $file)
WEnd
; Close the search handle
FileClose($search)

This is compiled into an exe called uncpathtest.exe. This is run via PSExec from my machine\\Lee with the following one line script

Run("C:\PStools\PSexec.exe \\Ben -i C:\uncpathtest.exe")

If I run uncpathtest.exe on Ben's machine then the script works correctly as the $search = FileFindFirstFile("\\Lee\Drive-c\BACK\*.*") section returns the handle of the file as stated in the help. But when the script is run from my machine through PSexec then it returns -1 and hence you get the error.

I have tried this with the paths mapped as well and still the same result. Through a dos box I can delete and add files using the UNC paths so I assume that it is not a permissions issue.

Link to comment
Share on other sites

This is compiled into an exe called uncpathtest.exe. This is run via PSExec from my machine\\Lee with the following one line script

Run("C:\PStools\PSexec.exe \\Ben -i C:\uncpathtest.exe")
Try starting psexec.exe with

Run(@ComSpec & " /k C:\PStools\PSexec.exe \\Ben -i C:\uncpathtest.exe")

If this works change "/k" to "/c".

Hope this helps.

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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