Click here to Skip to main content
15,912,021 members
Home / Discussions / C#
   

C#

 
JokeRe: combobox can't display -1? Pin
Peter_in_278010-Nov-11 16:17
professionalPeter_in_278010-Nov-11 16:17 
GeneralRe: combobox can't display -1? Pin
David_ADEI10-Nov-11 16:54
David_ADEI10-Nov-11 16:54 
GeneralRe: combobox can't display -1? Pin
Peter_in_278010-Nov-11 17:21
professionalPeter_in_278010-Nov-11 17:21 
GeneralRe: combobox can't display -1? Pin
SledgeHammer0111-Nov-11 7:07
SledgeHammer0111-Nov-11 7:07 
GeneralRe: combobox can't display -1? Pin
David_ADEI13-Nov-11 14:42
David_ADEI13-Nov-11 14:42 
GeneralRe: combobox can't display -1? Pin
BillWoodruff11-Nov-11 5:51
professionalBillWoodruff11-Nov-11 5:51 
AnswerRe: combobox can't display -1? Pin
OriginalGriff10-Nov-11 21:46
mveOriginalGriff10-Nov-11 21:46 
QuestionLaunch command as administrator Pin
jeremycafe111110-Nov-11 10:23
jeremycafe111110-Nov-11 10:23 
I am trying to launch csript as an administrator (the account logged in has admin rights). setting the startinfo.verb to runas does not work.

C#
ProcessStartInfo p1 = new ProcessStartInfo();
p1.UseShellExecute = true;
p1.Verb = "runas";
p1.FileName = "cscript";
p1.Arguments = "I:\\WPKG\\wpkg.js /synchronize /quiet /nonotify";
Process p = new Process();
p.StartInfo = p1;
p.Start();


The only way I can get it to start with privileges is to manually set the username and password. However I cannot hardcode that information or put it into configurations. Is there any way to have the cmd elevate without the login info?

I have also tried adding using (System.Security.Principal.WindowsIdentity.GetCurrent().Impersonate()) around the above code with no luck either.
AnswerRe: Launch command as administrator Pin
Eddy Vluggen10-Nov-11 10:29
professionalEddy Vluggen10-Nov-11 10:29 
AnswerRe: Launch command as administrator Pin
deanjott11-Nov-11 5:53
deanjott11-Nov-11 5:53 
QuestionRe: Launch command as administrator Pin
Mark Salsbery11-Nov-11 8:00
Mark Salsbery11-Nov-11 8:00 
QuestionLooking for help with an api hook that catches a messagebox from a 3rd party dll Pin
turbosupramk310-Nov-11 7:46
turbosupramk310-Nov-11 7:46 
QuestionWord Interop Supress / Handle Errors Pin
ezazazel10-Nov-11 3:54
ezazazel10-Nov-11 3:54 
QuestionHow to turn a Windows Form application into a library Pin
biop.codeproject10-Nov-11 0:20
biop.codeproject10-Nov-11 0:20 
AnswerRe: How to turn a Windows Form application into a library Pin
BobJanova10-Nov-11 1:24
BobJanova10-Nov-11 1:24 
AnswerRe: How to turn a Windows Form application into a library Pin
BillWoodruff10-Nov-11 5:24
professionalBillWoodruff10-Nov-11 5:24 
GeneralRe: How to turn a Windows Form application into a library Pin
biop.codeproject10-Nov-11 15:30
biop.codeproject10-Nov-11 15:30 
AnswerRe: How to turn a Windows Form application into a library Pin
Luc Pattyn10-Nov-11 16:08
sitebuilderLuc Pattyn10-Nov-11 16:08 
GeneralRe: How to turn a Windows Form application into a library Pin
biop.codeproject10-Nov-11 17:52
biop.codeproject10-Nov-11 17:52 
AnswerRe: How to turn a Windows Form application into a library Pin
Luc Pattyn10-Nov-11 18:26
sitebuilderLuc Pattyn10-Nov-11 18:26 
GeneralRe: How to turn a Windows Form application into a library Pin
BillWoodruff10-Nov-11 19:27
professionalBillWoodruff10-Nov-11 19:27 
AnswerRe: How to turn a Windows Form application into a library Pin
Ennis Ray Lynch, Jr.10-Nov-11 8:40
Ennis Ray Lynch, Jr.10-Nov-11 8:40 
GeneralRe: How to turn a Windows Form application into a library Pin
BobJanova10-Nov-11 23:23
BobJanova10-Nov-11 23:23 
QuestionUninstall a none Microsoft program on a remote machine via WMI Pin
AndieDu9-Nov-11 23:03
AndieDu9-Nov-11 23:03 
AnswerRe: Uninstall a none Microsoft program on a remote machine via WMI Pin
AndieDu10-Nov-11 11:15
AndieDu10-Nov-11 11:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.