changing drive letter gaining access to a network

This is a discussion on changing drive letter gaining access to a network within the A Brief History of Cprogramming.com forums, part of the Community Boards category; Hello, I wanted to make a program for myself and give it to my system administrator for a system flaw ...

  1. #1
    Registered User
    Join Date
    Nov 2001
    Posts
    7

    changing drive letter gaining access to a network

    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.

    The process is like this:

    type: net use h: \\(server)\(sub-directory)
    type: h:
    (go to directory H: for server)
    type: dir

    However, there was something going wrong with the type: H: thing, as I cannot, in my console application, see the directory information of the server I am "supposedly" on but instead, the C:\ directory I was on.


    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("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:\. The two getch() between the system("cd h:\\"); are for testing purposes (step by step process)

    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

  2. #2
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145

    grr

    Don't cross post, plz. What if the moderators see this..?
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  3. #3
    Registered User
    Join Date
    Nov 2001
    Posts
    7

    Hmm...

    Hmm, two posts in two topic areas cuz I don't know which one they belong into. Either way, I hope to get an answer soon. You have one related to my question?

    ~zornedge

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Sounds and Audio Decoding/ Drive Access
    By coldfusion244 in forum Windows Programming
    Replies: 4
    Last Post: 03-03-2005, 02:50 PM
  2. Frequent hard drive access question
    By Xzyx987X in forum Windows Programming
    Replies: 2
    Last Post: 04-27-2004, 11:47 PM
  3. Replies: 3
    Last Post: 05-25-2002, 07:29 AM
  4. Direct disk access in DOS
    By VirtualAce in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 02-26-2002, 02:52 PM
  5. How to access Network Card using C
    By vadiv in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 10-17-2001, 02:47 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21