/K keeps the console open while /C closes it afterwards.
/K keeps the console open while /C closes it afterwards.
something really strange is happening...
i'm having no problems using createProcess() to execute commands like:
cmd /C "net users > C:\usersList.txt\"but then run this simple command:cmd /C "at > C:\atList.txt\"
it doesn't workcmd /C "net localgroup > C:\gList.txt\"
it creates a empty gList.txt file...
i tried to run this command with system() and it doesn't work either
why is that?
"Artificial Intelligence usually beats natural stupidity."
Try removing the last (Bold red) backslash and then run the commandCode:cmd /C "net localgroup > C:\gList.txt\"
sorry...copy&past failure :S
the cmd will read:Code:strcpy_s(buffer, sizeof(buffer), "cmd /C \"net localgroup > C:\\gList.txt\"");
Why wont it work?cmd /C "net localgroup > C:\gList.txt"
"Artificial Intelligence usually beats natural stupidity."
Last edited by MeTh0Dz; 11-14-2008 at 10:52 AM. Reason: OP Edited
hi guys!
i resolved the problem...
it's all about authentication.
i have to insert my windows admin authentication in the service properties of my server application so that it can run the app in admin mode.
So i did it, and now i can run that command
"Artificial Intelligence usually beats natural stupidity."