Solved

Registry Hack on Log in

Posted on 2000-03-23
5
253 Views
Last Modified: 2010-04-13
Would it be possible to selectively change 2 registry entries on startup depending upon the user ID.

ie. if userid = x add these entries ....

This would have to be easily centrally managed as it could need configuration for a large number of users.

The environment is Windows 2000 client and server ?
0
Comment
Question by:davebarter
  • 4
5 Comments
 
LVL 2

Expert Comment

by:pschwan
Comment Utility
Edit the user profiles on the domain controller. If there are large batches, you can do it by groups.  
0
 

Accepted Solution

by:
pfie earned 100 total points
Comment Utility
I would suggest to run a cmd upon startup containing the line

rundll32 setupapi,InstallHinfSection DefaultInstall 128 <path>\doit.inf

Where doit.inf contains the regkeys to be added or deleted, or whatever you want.

Refer to http://www.inner-smile.com/
for a little tool called inf-tool, creating inf files from reg files e.g. if you are not familiar with inf file structure.

For environments with large numbers of users, i would suggest to work out the idea into a tool that is run automatically upon every startup by creating a key in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\Doit[<pathto>\doit.exe]

I implemented the tool to read the numbered inf files to be done from HKLM, and applying the infs from that list that havent be done before for that user and writing the lastdone inf files number to a key in HKCU.

In your case you may implement the tool to read from a list located (and maintained) on the server, if there are inf files to be done for the specific user, and applying these.

In delphi e.g. a function to apply an inffile would look like this:

function ApplyInfToCu(InfFile: String ) : Boolean;
//function ApplyInfToCu
//applies the infile given in InfFile to registry
var
  InfFilePath : string;    //pathname of the inf File
  exitcode    : integer;   //exitcode of the execute command
begin
  result := false;
  try
    Result:=WinExecute ('rundll32.exe setupapi,InstallHinfSection DefaultInstall 128 '+InfFile,0,true,exitcode);
  except
  end;
end; //ApplyInfToCu

Well, reading the textfile (from server) into a stringlist, looking for the username and picking out the infilenames is really simple. :o)
(the username you get with GetEnvString('USERNAME') and if you design the list like an ini file, you may take advantage of the class TiniFile, that pulls you out the values to a key very easily and serves them to you in a structured list).

rgds
Petra
0
 

Expert Comment

by:pfie
Comment Utility
I guess i should have written this into an answer?

hmm.. sorry, was my first try
0
 

Expert Comment

by:pfie
Comment Utility
I guess i should have written this into an answer?

hmm.. sorry, was my first try
0
 

Expert Comment

by:pfie
Comment Utility
I guess i should have written this into an answer?

hmm.. sorry, was my first try

Petra
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
Find out what Office 365 Transport Rules are, how they work and their limitations managing Office 365 signatures.
This video discusses moving either the default database or any database to a new volume.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

728 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now