Jump to content

Recommended Posts

Posted

I need to to create and switch to a windows profile without user interaction which I got to work for the most part.

I took care of creating a new account and I found a small trick online to switch a windows profile without user interaction(this needs to be done to create some registry which are changed later in the script).

"Trick" artical found here.

Basically, Kill the all exlorer.exe's then run a new explore.exe as the new user account I just made. This makes windows start setting up the profile and directories and it loads into the new enviorment. Works like a charm.

But Windows 8 seems to get stuck doing this trick. I think explorer is not making the $WM_SETTINGCHANGE call to the einviorment it use to to change the settings. >_<

Trying this in windows 8 DOES cause windows to setup the new profile. You can see the "personalized settings" loading screen popup. But later I am left at a black screen with a taskbar and not much to work with. I tried starting exploer again with the task manager and it made the process but I was still at a black screen.

I did some reasaerch was thinking doing a Dillcall to explorer with _WinAPI_SystemParametersInfo(, , , $SPIF_SENDCHANGE), but to be honest I have never done this b4 and its mostly shooting in the dark

Any advice?

I have made a small repoduction of the problem. Remeber the problem is on windows 8.

#include <WinAPI.au3>

;create newuser account^

;Login to new user account
$Username = "johnsmith"
$Password = "123pass"
$Processarray = ProcessList()
For $x = 1 To UBound($Processarray) - 1;search and distroy explorer.exe
    If StringInStr($Processarray[$x][0], "explorer.exe") > 0 Then
        $pid = $Processarray[$x][1]
        $handle = _WinAPI_OpenProcess(0x1, 0, $pid)
        DllCall("kernel32.dll", "int", "TerminateProcess", "int", $handle, "int", 1)
    EndIf
Next
RunAs($Username, @ComputerName, $Password, 1, "explorer.exe")

No problem can withstand the assault of sustained thinking.Voltaire

_Array2HTMLTable()_IEClassNameGetCollection()_IEquerySelectorAll()

  • Solution
Posted
  On 11/3/2013 at 11:18 PM, uncommon said:

My Main objective is to switch windows accounts without loseing teamviewer.

 

so no problem

TeamViewer had that feature

but you must have TeamViewer ID by Windows not by Profile

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

exactly

TeamViewer Host

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

That "trick" is for Windows XP, remember you're using Windows 8 like you told us!

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted
  On 11/3/2013 at 11:42 PM, UEZ said:

Install TV as a service.

 

Br,

UEZ

Hmm I see what you mean, that would require me install teamviewer or make a temporary service. I guess I should have mentioned that I dont connect to the same PC over and over. Its random, So I have to use the asumption that teamvier will not be installed..... or find a way to make a temporary service. Thanks for the thoughts. I should be about to run with this.

  On 11/4/2013 at 6:27 AM, guinness said:

That "trick" is for Windows XP, remember you're using Windows 8 like you told us!

Acautlly, I got it to work with XP - Windows 7. Yes windows 8 computer presnts a small problem but I might be able to do something with the services.

No problem can withstand the assault of sustained thinking.Voltaire

_Array2HTMLTable()_IEClassNameGetCollection()_IEquerySelectorAll()

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
×
×
  • Create New...