Page 1 of 1 1
Topic Options
#132036 - 2005-01-07 11:16 AM Sendkeys on a windows 2000/XP logon screen?
Finbom Offline
Fresh Scripter

Registered: 2003-06-27
Posts: 21
Hi!

I am trying to write a script that logon a remote computer to the network with a specified username and password.

Does anyone know how to this?

Some kind of send keys that works remotely and on the logonscreen..

Regards, Magnus Finbom

Top
#132037 - 2005-01-07 12:05 PM Re: Sendkeys on a windows 2000/XP logon screen?
AzzerShaw Offline
Seasoned Scripter
****

Registered: 2003-02-20
Posts: 510
Loc: Cheltenham, England
Why do you need to do this? Do you need to run an application as a certain user?

I would suggest looking at performing a scheduled task and running it as your user
_________________________
If at first you don't succeed, try again. Then quit. There's no use being a damn fool about it. - W.C Fields

Top
#132038 - 2005-01-07 02:42 PM Re: Sendkeys on a windows 2000/XP logon screen?
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
What are you trying to accomplish? Can you spell out your scenario a little more? There are some suggestions I could make, but I'm not sure where you are headed.
Top
#132039 - 2005-01-07 02:50 PM Re: Sendkeys on a windows 2000/XP logon screen?
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
How about using TweakUI?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#132040 - 2005-01-07 04:00 PM Re: Sendkeys on a windows 2000/XP logon screen?
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
I was thinking about setting Autologon properties. You could do that, then restart the computer.
Top
#132041 - 2005-01-07 04:04 PM Re: Sendkeys on a windows 2000/XP logon screen?
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
The original VNC had a scripting add-on. It doesn't look like it has made it into UltraVNC though. Don't know about other flavours.
Top
#132042 - 2005-01-07 04:49 PM Re: Sendkeys on a windows 2000/XP logon screen?
Co Offline
MM club member
***

Registered: 2000-11-20
Posts: 1342
Loc: NL
Something like this....

Code:

$sComp="remote computer"
$domain="your domain"
$user="your useraccount"
$password="your password"
$dom = WriteValue($sComp+"HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon","DefaultDomainName",$Domain,"REG_SZ")
$usr = WriteValue($sComp+"HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon","DefaultUserName",$User,"REG_SZ")
$pas = WriteValue($sComp+"HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon","DefaultPassword",$Password,"REG_SZ")
$frc = WriteValue($sComp+"HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon","ForceAutoLogon","1","REG_SZ")
$aut = WriteValue($sComp+"HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon","AutoAdminLogon","1","REG_SZ")



_________________________
Co


Top
#132043 - 2005-01-07 05:14 PM Re: Sendkeys on a windows 2000/XP logon screen?
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
I much prefer TweakUI to the old reg hack method for two reasons.
1. Tweak hides the password in a hidden are of the reg.
2. Even if you override the autologon at the keyboard, TweakUI still remembers the password at the next boot while the reg hack does not.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#132044 - 2005-01-07 07:54 PM Re: Sendkeys on a windows 2000/XP logon screen?
Co Offline
MM club member
***

Registered: 2000-11-20
Posts: 1342
Loc: NL
Quote:

I much prefer TweakUI to the old reg hack method for two reasons.
1. Tweak hides the password in a hidden are of the reg.
2. Even if you override the autologon at the keyboard, TweakUI still remembers the password at the next boot while the reg hack does not.




Les,

I can imagine you prefer Tweakui but I am 100 % sure that the above posted code remembers the password at the next boot...
_________________________
Co


Top
#132045 - 2005-01-07 08:07 PM Re: Sendkeys on a windows 2000/XP logon screen?
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Hmmm... sounds like a challenge.

OK, Hold down the shift key to subvert and logon locally, not to the domain.
Now reboot. I rest my case!
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#132046 - 2005-01-08 12:04 AM Re: Sendkeys on a windows 2000/XP logon screen?
Co Offline
MM club member
***

Registered: 2000-11-20
Posts: 1342
Loc: NL
I didn't tried it. You are probably right. But what to do if your remote computer is at another location? OK you can use Remote Desktop... But when you need a quick an dirty solution hacking the registry good enough for me...
_________________________
Co


Top
#132047 - 2005-01-08 12:30 AM Re: Sendkeys on a windows 2000/XP logon screen?
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Right you are... The reg hack is easy to do either remotely or by script. We have dozens of PCs that autologon in an industrial setting and the problem we had with the reg hack was that if someone subverted the logon, the password would disappear and an admin would have to be called to re-enter it.

Also, for security reasons, nobody but the admins are supposed to know the password. The machines are locked down with access to external media but if a user could logon at another machine that was not locked down, they could use the external media there to transfer stuff over the network.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#132048 - 2005-01-10 10:40 AM Re: Sendkeys on a windows 2000/XP logon screen?
Finbom Offline
Fresh Scripter

Registered: 2003-06-27
Posts: 21
Hi!

What I want to do is to send a scheduled WakOnLan signal to a selected pc and also send a account id and password that should be used to logon to the network.

I dont want to use the registrykeys for autologon becuse the machine will sometimes need to be used by some other users.

Regards, Magnus Finbom

Top
#132049 - 2005-01-10 10:45 AM Re: Sendkeys on a windows 2000/XP logon screen?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
eh, so you want to fire the PC up by itself and log on?
would this wake happen randomly or based on time or something?
_________________________
!

download KiXnet

Top
#132050 - 2005-01-10 11:27 AM Re: Sendkeys on a windows 2000/XP logon screen?
Co Offline
MM club member
***

Registered: 2000-11-20
Posts: 1342
Loc: NL
this will disable the autologon....


Code:

$dom = = WriteValue($sComp+"HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon","DefaultDomainName","","REG_SZ")
$usr = = WriteValue($sComp+"HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon","DefaultUserName","","REG_SZ")
$frc = = WriteValue($sComp+"HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon","ForceAutoLogon","0","REG_SZ")
$aut = = WriteValue($sComp+"HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon","AutoAdminLogon","0","REG_SZ")

_________________________
Co


Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1046 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.068 seconds in which 0.027 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org