Loading ...
Sorry, an error occurred while loading the content.

RE: [PBML] Computing free and used space in Windows

Expand Messages
  • KalyanRaj
    hi Ashish, the following script will give free space in c: and d: drives ( because my pc has two drives ) foreach $drive ( c: , d: ) { @lastline=`dir $drive`;
    Message 1 of 5 , Jan 2, 2006
    • 0 Attachment
      hi Ashish,

      the following script will give free space in c: and d: drives ( because my
      pc has two drives )

      foreach $drive ('c:','d:') {
      @lastline=`dir $drive`;
      print $lastline[$#lastline];
      }

      Hope this helps you....

      Regards,
      KalyanRaj



      -----Original Message-----
      From: perl-beginner@yahoogroups.com
      [mailto:perl-beginner@yahoogroups.com]On Behalf Of Ashish Gupta
      Sent: Tuesday, January 03, 2006 11:08 AM
      To: perl-beginner@yahoogroups.com
      Subject: [PBML] Computing free and used space in Windows


      Hi,
      I am writing a Perl script for capacity planning for Windows. I am
      supposed to find free space and used space for C drive. I tried using
      File:Find and also wrote my own recursive method for finding total size of
      the c: drive. But it takes a long time to compute. Is there any quick way to
      compute the total and free size of C drive?
      It would be very helpful if someone could give any pointer in this
      regards.

      Thanks for attention
      Ashish


      ---------------------------------
      Yahoo! for Good - Make a difference this year.

      [Non-text portions of this message have been removed]



      Unsubscribing info is here:
      http://help.yahoo.com/help/us/groups/groups-32.html
      Yahoo! Groups Links
    • Ashish Gupta
      Hi KalyanRaj, Thanks for the prompt reply. I am sorry I missed to mention that I am runnig this script on a network. Anyways this idea worked on the network
      Message 2 of 5 , Jan 3, 2006
      • 0 Attachment
        Hi KalyanRaj,
        Thanks for the prompt reply. I am sorry I missed to mention that I am runnig this script on a network. Anyways this idea worked on the network also. But still this is slow.
        When I run `dir /s /a` it still takes a long time. I think there should be better way to find the total capcity and free space of a drive.
        It would be great if you or someone else from the group could give some pointer.

        Regards
        Ashish.

        KalyanRaj <kalyanrajs@...> wrote:
        hi Ashish,

        the following script will give free space in c: and d: drives ( because my
        pc has two drives )

        foreach $drive ('c:','d:') {
        @lastline=`dir $drive`;
        print $lastline[$#lastline];
        }

        Hope this helps you....

        Regards,
        KalyanRaj
        thanks for your reply. Sorry I was not clear in my fairst mail. Actually I want to run this script on a network to compute size of disk of many servers.


        -----Original Message-----
        From: perl-beginner@yahoogroups.com
        [mailto:perl-beginner@yahoogroups.com]On Behalf Of Ashish Gupta
        Sent: Tuesday, January 03, 2006 11:08 AM
        To: perl-beginner@yahoogroups.com
        Subject: [PBML] Computing free and used space in Windows


        Hi,
        I am writing a Perl script for capacity planning for Windows. I am
        supposed to find free space and used space for C drive. I tried using
        File:Find and also wrote my own recursive method for finding total size of
        the c: drive. But it takes a long time to compute. Is there any quick way to
        compute the total and free size of C drive?
        It would be very helpful if someone could give any pointer in this
        regards.

        Thanks for attention
        Ashish


        ---------------------------------
        Yahoo! for Good - Make a difference this year.

        [Non-text portions of this message have been removed]



        Unsubscribing info is here:
        http://help.yahoo.com/help/us/groups/groups-32.html
        Yahoo! Groups Links








        Unsubscribing info is here: http://help.yahoo.com/help/us/groups/groups-32.html



        SPONSORED LINKS
        Basic programming language C programming language Computer programming languages The c programming language C programming language List of programming languages

        ---------------------------------
        YAHOO! GROUPS LINKS


        Visit your group "perl-beginner" on the web.

        To unsubscribe from this group, send an email to:
        perl-beginner-unsubscribe@yahoogroups.com

        Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


        ---------------------------------






        ---------------------------------
        Yahoo! Photos
        Ring in the New Year with Photo Calendars. Add photos, events, holidays, whatever.

        [Non-text portions of this message have been removed]
      • Mohsen Basirat
        Dear Ashish you can using snmp to monitor Disk usage of server and workstations using Net::SNMP Module and you need to install/enable SNMP service on machines
        Message 3 of 5 , Jan 3, 2006
        • 0 Attachment
          Dear Ashish
          you can using snmp to monitor Disk usage of server and workstations
          using Net::SNMP Module and you need to install/enable SNMP service on machines
          anyway you can using snmputil.exe from windows Resource kit too to get snmp values from snmp service
          read this link
          http://www.loriotpro.com/ServiceAndSupport/How_to/How_to_Control_DiskSpace_Usage.php
          and find snmputil from here
          http://www.petri.co.il/download_free_reskit_tools.htm
          Regards



          Ashish Gupta <ashish_gupta_cal@...> wrote: Hi KalyanRaj,
          Thanks for the prompt reply. I am sorry I missed to mention that I am runnig this script on a network. Anyways this idea worked on the network also. But still this is slow.
          When I run `dir /s /a` it still takes a long time. I think there should be better way to find the total capcity and free space of a drive.
          It would be great if you or someone else from the group could give some pointer.

          Regards
          Ashish.

          KalyanRaj <kalyanrajs@...> wrote:
          hi Ashish,

          the following script will give free space in c: and d: drives ( because my
          pc has two drives )

          foreach $drive ('c:','d:') {
          @lastline=`dir $drive`;
          print $lastline[$#lastline];
          }

          Hope this helps you....

          Regards,
          KalyanRaj
          thanks for your reply. Sorry I was not clear in my fairst mail. Actually I want to run this script on a network to compute size of disk of many servers.


          -----Original Message-----
          From: perl-beginner@yahoogroups.com
          [mailto:perl-beginner@yahoogroups.com]On Behalf Of Ashish Gupta
          Sent: Tuesday, January 03, 2006 11:08 AM
          To: perl-beginner@yahoogroups.com
          Subject: [PBML] Computing free and used space in Windows


          Hi,
          I am writing a Perl script for capacity planning for Windows. I am
          supposed to find free space and used space for C drive. I tried using
          File:Find and also wrote my own recursive method for finding total size of
          the c: drive. But it takes a long time to compute. Is there any quick way to
          compute the total and free size of C drive?
          It would be very helpful if someone could give any pointer in this
          regards.

          Thanks for attention
          Ashish


          ---------------------------------
          Yahoo! for Good - Make a difference this year.

          [Non-text portions of this message have been removed]



          Unsubscribing info is here:
          http://help.yahoo.com/help/us/groups/groups-32.html
          Yahoo! Groups Links








          Unsubscribing info is here: http://help.yahoo.com/help/us/groups/groups-32.html



          SPONSORED LINKS
          Basic programming language C programming language Computer programming languages The c programming language C programming language List of programming languages

          ---------------------------------
          YAHOO! GROUPS LINKS


          Visit your group "perl-beginner" on the web.

          To unsubscribe from this group, send an email to:
          perl-beginner-unsubscribe@yahoogroups.com

          Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


          ---------------------------------






          ---------------------------------
          Yahoo! Photos
          Ring in the New Year with Photo Calendars. Add photos, events, holidays, whatever.

          [Non-text portions of this message have been removed]



          Unsubscribing info is here: http://help.yahoo.com/help/us/groups/groups-32.html



          SPONSORED LINKS
          Basic programming language C programming language Computer programming languages The c programming language C programming language List of programming languages

          ---------------------------------
          YAHOO! GROUPS LINKS


          Visit your group "perl-beginner" on the web.

          To unsubscribe from this group, send an email to:
          perl-beginner-unsubscribe@yahoogroups.com

          Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


          ---------------------------------






          ---------------------------------
          Yahoo! DSL Something to write home about. Just $16.99/mo. or less

          [Non-text portions of this message have been removed]
        • Jenda Krynicky
          From: Ashish Gupta ... use Win32::FileOp qw(GetDiskFreeSpace); $freeSpaceForUser = GetDiskFreeSpace C: ; # or
          Message 4 of 5 , Jan 3, 2006
          • 0 Attachment
            From: Ashish Gupta <ashish_gupta_cal@...>
            > Hi,
            > I am writing a Perl script for capacity planning for Windows. I
            > am supposed to find free space and used space for C drive. I
            > tried using File:Find and also wrote my own recursive method for
            > finding total size of the c: drive. But it takes a long time to
            > compute. Is there any quick way to compute the total and free
            > size of C drive?
            > It would be very helpful if someone could give any pointer in
            > this regards.
            >
            > Thanks for attention
            > Ashish

            use Win32::FileOp qw(GetDiskFreeSpace);

            $freeSpaceForUser = GetDiskFreeSpace 'C:';
            # or
            ($freeSpaceForUser,$totalSize,$totalFreeSpace)=GetDiskFreeSpace 'C:';


            You can get Win32::FileOp from CPAN or via PPM.

            Jenda
            ===== Jenda@... === http://Jenda.Krynicky.cz =====
            When it comes to wine, women and song, wizards are allowed
            to get drunk and croon as much as they like.
            -- Terry Pratchett in Sourcery
          Your message has been successfully submitted and would be delivered to recipients shortly.