asp.net - Copy to C Drive(Root) as administrator -


i want copy file in c root directory administrator, working fine path. user using having administrator rights still i'm unable copy.

my code is:

string strcmdtext = string.empty; strcmdtext = "copy /y " + "\"" + fullpath + "\"" + " " + "\"" + _name.fullpath + "\\" + subject + ".msg" + "\""; system.diagnostics.process process = new system.diagnostics.process(); system.diagnostics.processstartinfo startinfo = new system.diagnostics.processstartinfo(); startinfo.filename = "cmd.exe"; startinfo.verb = "runas"; startinfo.createnowindow = true; startinfo.redirectstandardoutput = true; startinfo.redirectstandardinput = true; startinfo.useshellexecute = false; startinfo.arguments = strcmdtext; startinfo.windowstyle = system.diagnostics.processwindowstyle.hidden; process.startinfo = startinfo; process.start(); streamwriter sw = process.standardinput; sw.writeline(strcmdtext); sw.close(); process.waitforexit(); string output = process.standardoutput.readtoend(); process.dispose(); process.close(); 

i getting following error: you don't have appropriate permission perform operation.

taken comment. looks uac. try turning uac off , if works, know go next!


Comments

Popular posts from this blog

stringtemplate - StringTemplate4 if conditional with length -

shader - OpenGL Shadow Map -