PDA

View Full Version : how to run DOS command with


wasim21k
04-26-2007, 02:14 PM
hi gusy
here i have another problem i m trying to run cacls command but can not figure out what to try next, can you guys point me to the right direction please. :huh

CACLS E:\temp /E /G "Power Users":F

wasim21k
04-26-2007, 02:31 PM
i think i can answer my question now
File.Run("cacls.exe", "e:\\temp /E /G Users:F", "", SW_SHOWNORMAL, false);
but there is one more problem after this
File.Run("cacls.exe", "E:\\temp /E /G "Power Users":F", "", SW_SHOWNORMAL, false);
wat if i have to add ""

RizlaUK
04-26-2007, 02:47 PM
then you need escape the quotes with a backslash


File.Run( "cacls.exe", "E:\\temp /E /G \"Power Users\":F", "", SW_SHOWNORMAL, false);

output enhanced with AMS Code Pretty (http://www.indigorose.com/forums/showthread.php?t=19409)

wasim21k
04-26-2007, 03:23 PM
thanx RizlaUK,
it is working the way it should be.
thanx:yes

RizlaUK
04-26-2007, 03:59 PM
no problem ;)