crazy windows programming

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • crazy windows programming

      I don't actually have a programming job, but I've found a porject I can do that may impress the higher ups. I want to create a program the reads information from swipe cards, which is a really easy thing to do. The hard part is that I want it to be fool proof, so I'm going to actually make a user with this program set to be its Shell (I already figured out how to THAT in the registry). My question is, is there an API function to create a new user? I also have to figure out how to write to the Registry, too...

      If there is not an API call for the new user, is there anyway I can run any commands to do it automatically and have some sort of install script do it? Or do I have to do it through control panel every time?
      -Larrik Jaerico

      www.LarrikJ.com
    • RE: crazy windows programming

      I'm a little unclear about why you'd want to "create a user" - access to a particular CPU and any data it can see on the local network is a serious security issue in itself. Do you mean swiping a card to log someone in? Or do you mean creating a brand new user with permenant or temporary access priv's ?

      Oh - and what "higher ups" are you talking about?
      Mr.Mike
      Author, Programmer, Brewer, Patriot
    • RE: crazy windows programming

      I think you are asking about the Win32 API to create workstation (or domain) users.

      This is in the Networking API (as this is historically where logging in occurred). If you have an MSDN library look in:
      - Platform SDK / Networking and Distributed Services / Networking (Net)

      Online check:
      - msdn.microsoft.com/library/def…mt/netmgmt/netuseradd.asp

      Of course there is the question of how you intend to run this as the executing context requires Administrator permissions.

      For Active Directory there are Active Directory Services Interface ADSI) methods that are referred to in the link above.

      Alasdair Russell
      Gamma Testing - Where testing is extended to the full user community (AKA Shipping the Program)
    • I was intentionally unclear about my goal, so I will describe it in detail (I already read Dhericean's response, which is very helpful and spot-on to one of my main goals in the project).

      I work for a company as the computer guy/tech. The company is 24-hour health care at our group homes, and each home has a computer (in theory). Our 3rd shift staff has a tendency to sleep, so I want to make a program that makes them slide their ID card through a machine every hour to prove they are awake. There are machines that do this very easily, but they are expensive, and magnetic strpie cards are very very easy to use (it's no different than if you were to type the contents of the card on the keyboard and press enter, it's plain text). I'd prefer it to be more secure and not allow the staff to open Notepad, slide the card, figure out the formatting of the card, and then write a small program which pipes their card info into my program every hour (which is really not that difficult).

      My idea: set my program as the shell of the user (which is really really easy to do), and if the manager wants to use the computer, they must CTRL-ALT-DEL and log off, and back on as themselves. This part I know works.

      Ideally, I'd like the program to make a new user account on the machine (XP or 2000 or better only), and write to the registry to set the shell, all on its own, so that in the future after I'm gone, this program is easy to use. I believe Dhericean linked me to a site which will help me with the user creation thing (though I have not checked it out yet), and I don't think finding a place that tells me how to write Registry keys shoudl be a problem (I've just never seen a program create a user account for itself before, and wasn't sure if it was possible).

      I hope that is clearer. Sorry it isn't directly videogame related, you are just the only programming site I visit.
      -Larrik Jaerico

      www.LarrikJ.com
    • I assume the mag-stripe cards already exist? Like employee ID cards?
      Mr.Mike
      Author, Programmer, Brewer, Patriot
    • Yuk - I hate that too - it's too easy to hit that huge "Reply" button. Maybe I'll investigate tweaking the PHP code to make it do the right thing.
      Mr.Mike
      Author, Programmer, Brewer, Patriot
    • My NetUserSetInfo isn't recognizing Administrators as a real group. A test run with NetGroupEnum shows that in fact, it does not see ANY groups. Does this not work with XP?

      If you can't help, that's fine...but it's driving me nuts!
      -Larrik Jaerico

      www.LarrikJ.com