jp10558 Posted June 12, 2009 Share Posted June 12, 2009 I'm trying to finish off my remote editior GUI for SuRun, and the thing I'm having problems with is how to remove a user from the ini file. Here's the problem. An ini looks like this: expandcollapse popup[SuRun] Version=1.2.0.6 BlurDesk=1 FadeDesk=1 SavePW=1 UseCancelTimeOut=1 CancelTimeOut=40 ShowCancelTimeOut=0 PwTimeOut=5 AdminNoPassWarn=2 CtrlAsAdmin=0 CmdAsAdmin=0 ExpAsAdmin=1 RestartAsAdmin=1 StartAsAdmin=0 HideExpertSettings=0 UseIShExHook=1 UseIATHook=1 TestReqAdmin=1 ShowAutoRuns=1 ShowTrayAdmin=10 NoConvAdmin=0 NoConvUser=0 DefHideSuRun=0 [User0] Name=DOMAIN\user IsLocalUser=0 NoRunSetup=1 RestrictApps=1 UserTSA=2 HideFromUser=0 ReqPw4Setup=0 [WhiteList0] 0="C:\WINDOWS\system32\control.exe hdwwiz.cpl" [WhiteListFlags0] 0=1 [User1] Name=test IsLocalUser=1 NoRunSetup=1 RestrictApps=1 UserTSA=2 HideFromUser=0 ReqPw4Setup=0 [WhiteList1] 1="C:\TEMP\foo2" [WhiteListFlags1] 1=1 The problem I'm having is if I remove the user DOMAIN\user from the allowed users, by default using the IniDeleteSection I can remove User0, WhiteList0 and WhiteListFlags0. The problem is I need to roll back User1 etc to User0 for the program to then reaccept the settings. This needs to work with an arbitrary # of users and arbitrary removal of the user. Anyone have any ideas about how to do this? Link to comment Share on other sites More sharing options...
Skruge Posted June 12, 2009 Share Posted June 12, 2009 The problem I'm having is if I remove the user DOMAIN\user from the allowed users, by default using the IniDeleteSection I can remove User0, WhiteList0 and WhiteListFlags0. The problem is I need to roll back User1 etc to User0 for the program to then reaccept the settings. This needs to work with an arbitrary # of users and arbitrary removal of the user.Anyone have any ideas about how to do this?I would use IniDelete to remove a user section, then IniRenameSection to reorder them.Is the numbering sequence important?For example, if you have users 0-9 and delete #2, can User9 become User2, or do 3-9 all need to shift to 2-8? [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font] Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now