How can I have a Pcomm session automatically log in to a specific connection..? - vbscript

We have an AS400 DB2 v7r3m0 system, to which we connect with PComm v6 emulator sessions. For a certain high-throughput printer, there's a stand-alone PC acting as a print server, with a PComm printer session.
I'd like to have that PComm printer session automatically start, make the connection, and log in, so I can have it run from Windows Startup.
I've been able to record & clean up a VBS macro that logs in once the connection is made, but not the connection process. Unless I'm missing something, macros cannot be recorded or run until the connection is made.
Is there a built-in process by which the connection can be made automatically..?
If not, I'm assuming it could be done with autECLConnMgr and related libraries in VBS, but the IBM documentation on that is a little deep for me. If that's the way to go, could someone provide an example..?
EDIT: This is the dialog I speak of. This sometimes precedes the opening of any emulator windows, sometimes from the IBM i control panel applet, and so it cannot be scripted through an emulator window way, and thus my assumption it needs to go through WScript.

Honestly, I think you should look into using the Windows scripting language AutoHotkey to fill in any gaps in functionality that you can't achieve by other means. Virtually anything you can do by hand on a PC can be automated using AutoHotkey, including keyboard and mouse input.

Related

How to simulate the behavior of a remote desktop without showing the screen

I should make a program that simulates the behavior of a remote desktop but without showing the screen of the server to the client.
I can use any programming language, but the client must be on Android mobile device and the server's operating system must be Windows.
I do not know how to Start. I was thinking about two possibilities:
1- Use a socket. But the difficulty was to give commands outside of the programming environment.
2- Use a rdp already done but turn off the display screen (setting is not present in the rdp I know). Who can help me?
Thank you

How to send logoff in Remote Desktop ActiveX control?

I'm writing a Delphi application which has an intergrated Remote Desktop ActiveX Control (a.k.a MSTSCLib - but specifically TMsRdpClient9). I am able to successfully connect to and log in to the target machine, and I am able to Disconnect from the target machines using RDPClient.RequestClose() or RDPClient.Disconnect(), but I need to know how to send a Logoff/Logout command to the RDP Client.
I have gone through every interface of the control, and I cannot find any command which seems to do this functionality. I have also gone through the documentation linked above, and the method I need to use seems to elude me.
I have also searched Google, and Stack Overflow for similar questions, and have found none.
Can somebody please give me a hand

RASPHONE.exe behavior in XP and Windows 7

I called "Rasphone.exe" from my C code using "ShellExecuteEx" to create a dial-up connection. I found different behaviour on Windows XP and Windows 7.
Behavior in Windows XP :
The RASDial connection gets created without any Pop-up Window.
Behaviour in Windows 7 :
A DialUp window Pops up asking number to be dialed. I didnt enter any number, and clicked "Dial" button. Connection gets connected. The below is the snap-shot window which I get in windows 7?
What is the reason for the difference in behaviour?
What is the reason for the difference in behaviour?
Windows 7 is a different operating system than Windows XP. Before Metro was invented, the Windows team didn't have anything to do, so they sat around changing a bunch of old code just to see if anyone noticed. Looks like you've found one of the things they changed.
No worries, though. The code you had was doomed in the first place. The proper way to dial a network connection is not to launch the network dialer application, it's to call the API provided for this purpose.
The name of the API you want is WinINet, and you'll find the documentation for it here. In particular, you'll be interested in the Establishing a Dial-Up Connection to the Internet section, which mentions the InternetDial function.
Of course, they've changed this, too. Starting with Windows Vista, this function uses the RAS API internally to establish the connection. Skip the middle man by calling the RasDial or RasDialDlg functions directly.

Making Windows service beep in Windows 2008/7/Vista

this question has been asked before but there is no conclusive answer.
I've written a Windows service in Delphi, which needs to generate a beep under certain condition. This works fine on XP, however fails in Windows 7 or 2008.
Note:
Beep can work if i create a console program instead of a service - using PC speakers.
Beep cannot work in a service even if i enable "allow service to interact with desktop" or even assign administrator rights to the service.
My question: Is there a way I can call beep API such that it works in a service? Thanks.
You can't do this in Vista and up. Services run in a different session and so don't have access to the speaker.
Update: Someone found a way here. it involves IOCTL, and is available to drivers and services.
Original answer:
The only way I know of to interact with the user would be to have your Service communicate with a small user-agent process which would be added to HKEY_LOCAL_MACHINE\CurrentUser\Run to autorun.
This is the usual pattern in vista and win7 where no user interaction is possible directly from the service:
MyLittleService.exe has no access to the user. But it can communicate via a named pipe with a tray icon utility.
MyLittleTrayIcon.exe communicates to the service, and can also be told to signal the user with message boxes, beep via whatever method (windows sound effects probably would be better than trying to access the PC speaker which is not guaranteed to exist on every PC anymore), etc, and maybe even can be used to control the service (restart it, reload the configuration etc).

Need to Unlock Win7 Desktop from C#

I am working on some Automation Project where one needs to perform some action related to display resolution.Change the Display resolution , Lock the Desktop and then Unlock Desktop again to check that resolution remained same.
I am able to perform LockWorkstation but unable to have any thing for Unlock Workstation.
Can any body help me regarding unlocking Display with help of C# and in Win 7 ?
I heard of GINA dll which can help ,but I dont know anything about it.Can this be used for Win7 and .NET 3.5?
Thanks
_Prat.
I don't think that doing this is technically feasible. GINAs were deprecated after XP and the new way to provide custom authentication in Vista/Win7 is to use the ICredentialProvider
interface. Even if you get this working you'll still have to somehow send the the secure attention sequence, i.e. ctrl-alt-delete, to initiate the logon. Sending ctrl-alt-delete programmatically is itself something that is difficult to do and not really supported.
This sounds like a lot of work for some automation and probably won't have much ROI. Can you test this by logging the user off completely and then logging back in? If so, then you could set your test machine to auto-logon the user. When you log-off it will shut down the session and then promptly log the user back in and you could check if the resolution is what you expect.

Resources