Đăng Nhập

Vui lòng khai báo chính xác tên truy cập và mật khẩu!

Quên mật khẩu?

    Code Hiện thư mục file trên đĩa cứng

      Admin
      Admin

      Giới tính : Nam

      Đến từ : TPHCM

      Ngày Tham gia : 03/04/2011

      Tổng số bài gửi : 2292

      #1

       Wed Jul 18, 2012 9:35 am

      Code Hiện thư mục file trên đĩa cứng
      Code:

      #include <iostream.h>
      #include <conio.h>
      #include <windows.h>
      #include <stdlib.h>
      #include <stdio.h>
      #include <time.h>
      #include <math.h>

      void DungLenh(const char *lenhpro)
      {
          char s[1000];
          STARTUPINFO si;
          PROCESS_INFORMATION pi;

          ZeroMemory( &si, sizeof(si) );
          si.cb = sizeof(si);
          ZeroMemory( &pi, sizeof(pi) );

          sprintf(s,"\"cmd\" /c %s",lenhpro);
          CreateProcess( NULL,s,NULL,NULL,FALSE,0,NULL,NULL,&si,&pi );
      }

      int main(int argc, char* argv[])
      {
         
              cout<<" Xuat Thu muc va tap tin co trong dia C tren DOS \n";
              DungLenh("DIR C:\\");
         
              DungLenh("pause");

          return 0;

      }
      Admin
      Admin

      Giới tính : Nam

      Đến từ : TPHCM

      Ngày Tham gia : 03/04/2011

      Tổng số bài gửi : 2292

      #2

       Wed Jul 18, 2012 10:07 am

      Hiện cây thư mục
      Code:

      #include <iostream.h>
      #include <conio.h>
      #include <windows.h>
      #include <stdlib.h>
      #include <stdio.h>
      #include <time.h>
      #include <math.h>

      void DungLenh(const char *lenhpro)
      {
          char s[1000];
          STARTUPINFO si;
          PROCESS_INFORMATION pi;

          ZeroMemory( &si, sizeof(si) );
          si.cb = sizeof(si);
          ZeroMemory( &pi, sizeof(pi) );

          sprintf(s,"\"cmd\" /c %s",lenhpro);
          CreateProcess( NULL,s,NULL,NULL,FALSE,0,NULL,NULL,&si,&pi );
      }

      int main(int argc, char* argv[])
      {
              DungLenh("TREE E:\\Javis");
         
              DungLenh("pause");

          return 0;

      }