How i can create local system account with visual studio cpp?

I created a cli with cpp (VS2010) and i get a variable ((*argument)["USERNAME"]) from console. But i cant use in this line


DirectoryEntry *userEntry = computerEntry->Children->Add(S"username", S"user");


I want to use instead (*argument)["USERNAME"] of S"username".

How i can use ?

Thanks for all...

//Build the path, and then bind to computer.
String *adsPath = String::Format(S"WinNT://{0},computer", Environment::MachineName);
DirectoryEntry *computerEntry = new DirectoryEntry(adsPath);

DirectoryEntry *userEntry = computerEntry->Children->Add(S"username", S"user");
userEntry->Properties->get_Item(S"Description")->Add(S"Test user from .NET");

//Set the password, and then commit the changes.
String *stringArray[] = new String *[1];
stringArray[0] = S"#12353Abc";
userEntry->Invoke(S"SetPassword", stringArray);

//Add the new user to a group.
DirectoryEntry *groupEntry = computerEntry->Children->Find(S"Administrators");
stringArray[0] = userEntry->Path;
groupEntry->Invoke(S"Add", stringArray);

Looks like C++/CLI, not C++. Not many CLI'ers around this forum. Try the MSDN forums instead. You'll get an answer faster, I would say.
Topic archived. No new replies allowed.