Hello, I wanted to make a program for myself and give it to my system administrator for a system flaw I found in the school network.
What we have: A network with several users that have his/her own personal folder.
What is flawed: Other people can get in other certain users' folders, most are blocked.
What I want to do: Get a directory listing of those accessibly through my user name
Hark, nobody make the source code to do this. I only want to find out how you can change into another directory in DOS (The system("h:\") command does not work.
Here's a small code snippet that I've done so far:
#include <iostream>
using namespace std;
#include <conio.h>
#include <stdlib.h>
int main(int argc, char* argv[])
{
character = _getch();
switch(character)
{
case 97:
cout << "Type in a server name.\n";
cin.getline(server, 49);
system("cls");
system("net use h: \\\\(server IP/name)\\c");
getch();
system("cd h:");
getch();
system("cd h:\\");
system("dir");
cout << "You have ? changed the directory ?";
So far, I cannot change the directory using the cd command, and then using dir, because it will always show the C:\ directory, not the H:\.
As I hope you can see (it's pretty easy to figure out what my code does) I only need to find out how to change to another directory in a network using the system() command if possible. (Please, simplified answers, I'm a beginner.)
Thank you
~zornedge