Sign in to follow this  
Followers 0
Simulator

Connecting To Remote PC

5 posts in this topic

#1 ·  Posted (edited)

Hi,

I'm trying to create a script that i can run that will allow me to connect to a remote PC. The purpose of this is just to allow me to print. The way this happens is that i have to search for the computer on my network then open it and enter a username and password and then it will allow me to print. I want to be able to do this preferably without opening search with the Send function. Below is the code so far. It is eventually going to be able to select from multiple computers. Ignore the list for the moment. If anyone can help please post here.

EDIT: Thought I would say, I want to do the above type of search as such without the user seeing the Search Window open. All I want is the login to appear.

Thanks, Simulator

#include <GUIConstants.au3>

Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=j:\koda_1.6.0.2\forms\remoteconnect.kxf
$Form1 = GUICreate("Remote Connect", 218, 87, -1, -1)
GUISetOnEvent($GUI_EVENT_CLOSE, "AForm1Close")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "AForm1Minimize")
GUISetOnEvent($GUI_EVENT_MAXIMIZE, "AForm1Maximize")
GUISetOnEvent($GUI_EVENT_RESTORE, "AForm1Restore")
$ComputerList = GUICtrlCreateList("", 8, 8, 201, 19)
GUICtrlSetOnEvent(-1, "ComputerListClick")
GUICtrlSetTip(-1, "Select The Computer You Want To Connect To")
$buttonConnect = GUICtrlCreateButton("Connect", 8, 48, 57, 25, 0)
GUICtrlSetOnEvent(-1, "buttonConnectClick")
GUICtrlSetTip(-1, "Connect To Selected Computer")
$buttonAbout = GUICtrlCreateButton("About", 80, 48, 57, 25, 0)
GUICtrlSetOnEvent(-1, "buttonAboutClick")
$buttonExit = GUICtrlCreateButton("Exit", 152, 48, 57, 25, 0)
GUICtrlSetOnEvent(-1, "buttonExitClick")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    Sleep(100)
WEnd
        
Func AForm1Close()
    ; Exits The Script
    Exit
EndFunc

        
Func AForm1Maximize()

EndFunc

        
Func AForm1Minimize()

EndFunc

        
Func AForm1Restore()

EndFunc

        
Func buttonAboutClick()
    ; Display A Simple ABout Dialog
    MsgBox(64, "About", "Program By: James Pannell (pannellj@vic.chariot.net.au)")
EndFunc

        
Func buttonConnectClick()
    ;Display Message Box to confirm connect.
    ;MsgBox(4, "Confirm?", "Are You Sure You Want To Connect To:")
    If MsgBox(4, "Confirm?", "Are You Sure You Want To Connect To:") = 6 Then
        Sleep(200)
        MsgBox(48, "Exclamation", "When The Dialog shows, enter your username and password!")
        Call ("Connecting")
    Else

    EndIf
EndFunc

        
Func buttonExitClick()
    ; Exits The Script
    Exit
EndFunc

        
Func ComputerListClick()

EndFunc

Func Connecting()

#Region ### START Koda GUI section ### Form=f:\koda_1.6.0.2\forms\remoteconnectconnecting.kxf
$frmConnecting = GUICreate("Connecting......", 279, 104, -1, -1, BitOR($WS_CAPTION,$WS_BORDER,$WS_CLIPSIBLINGS))
$lblConnecting = GUICtrlCreateLabel("Connecting To Remote Computer. Please Wait..........", 8, 80, 255, 17)
$Avi1 = GUICtrlCreateAvi("J:\Satellite.avi", -1, 104, 8, 52, 53, BitOR($ACS_TRANSPARENT,$ACS_AUTOPLAY))
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch

WEnd


EndFunc
Edited by Simulator

Share this post


Link to post
Share on other sites



BUMP. Can anyone help?

Regards, Simulator

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Dumb question, but are you trying to use their printer, or yours to print what they have on their screen? It doesn't make sense to remote in just so you can print. The only reasons to remote into someone elses PC is to take control of it, capture information, or file transfer. Printing just doesn't make sense.

Just share the printer if it is connected locally on their PC, then it will show up on the network. Otherwise, make the printers network printes, and have them all setup on a server that can be made a print server. Have everyone connect to that server to allow for them to print.

If I'm missing something, please explain. I'm not following your reasoning in your first post.

Edited by vollyman

Share this post


Link to post
Share on other sites

Coupled with a Wake on Lan script this would be quite handy to shut down the comp

Share this post


Link to post
Share on other sites

Sorry if i wasn't clear enough. I want to use the other computers printer. Its always being shared but unfortunately I have to connect as if I want to take a file they are sharing off their computer. The computer is running Windows 2000 and I'm running XP. Its difficult to explain. If i want to print via word, it will usually say the printer is not available even though both computers are on, the printers on and network ports are enabled as well as printer sharing. So in order to print using their printer, I have to search for their computer (Start -> Search -> Computer On Network) double click the computer and then enter a username and password as set on that computer. It sounds really weird but its the only way it will work. Could it be because its a USB printer?

Anyway, I've got an old PC that i'm trying to install linux on so if i can use that as a Server (which was my intention) i can connect to that.

Thanks,

Simulator

Share this post


Link to post
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
Sign in to follow this  
Followers 0