LogonUser or ImpersonateUser in Win9x?

Posted on 2003-03-25
Medium Priority
Last Modified: 2008-02-01
I need to connect to network resources with a different user name in Win9x.  The LogonUser api is only for NT.  
My intention is to logon and impersonate a user account, and then CreateProcessAsUser 0r CreateProcess to access the files on a network drive.  Windows should then authenticate with the new logon I have used.

Can anyone help with this please.
Question by:TimW1
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
LVL 10

Expert Comment

ID: 8207535
Not possible on Win9x.

Author Comment

ID: 8207878
Can you think of any other way around this that would not use LogonUser.  If I type "\\192.168.0.x" in the RUN dialog of win9x pc, and my user doesn't have access to the destination pc it will display a User and Password dialog to authenticate with the computer.  Can this can be done in some way using code and api calls?
LVL 10

Accepted Solution

aeklund earned 750 total points
ID: 8220894
You can try this:


But again, what your asking is not possible on win98 because win98 not designed to have multiple logon sessions like NT and above are.

Author Comment

ID: 8265707
I have accepted your answer as there seems to be no direct way.  However the code you put was for NT, and there are possibly some other options such as an MTS object running on 2x/xp or using the map drive api and pass user info so I can't give you an A grade sorry.  Thanks for your help.
LVL 10

Expert Comment

ID: 8271933
Not a problem, but win9x is limited when it comes to this... But you are correct, you can use the WNetUseConnection api to map a drive letter as a different user...

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question