Computing.Net > Forums > Programming > get c:\ space

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

get c:\ space

Reply to Message Icon

Name: lee123abc
Date: October 30, 2009 at 05:54:38 Pacific
OS: win xp 5.1.2600
CPU/Ram: 3mhz/2 gig
Product: Dell / PRECISION
Subcategory: Batch
Comment:

Hi all!

I want to get the free space and I know there are loads of topics already. I have read through them.
I just wanted to know if something like this would work. Please take a look. Thank you.

dir c:\|find /i "bytes free" >> set space=

You see I want to set the variable "space" without creating a temporary file on my hard drive.



Sponsored Link
Ads by Google

Response Number 1
Name: lee123abc
Date: October 30, 2009 at 07:44:30 Pacific
Reply:

I have this but as you see it creates a file called 1.txt
There must be a way

@echo off & cls
dir c:\|find /i "bytes free">> 1.txt
setlocal enabledelayedexpansion
for /f "tokens=* delims=" %%A in (1.txt) do (
set line=%%A
set line=!line:~26,-11!
echo.!line!)
del 1.txt & pause>nul


0

Response Number 2
Name: Razor2.3
Date: October 30, 2009 at 10:34:13 Pacific
Reply:

Where is everyone today?

for /f "tokens=3" %%a in ('dir c:\ ^|find "bytes free"') do set space=%%a


0

Response Number 3
Name: Mechanix2Go
Date: October 31, 2009 at 03:40:50 Pacific
Reply:

Hi R2,

I'm off to a bit of a slow sttart.


=====================================
Helping others achieve escape felicity

M2


0

Response Number 4
Name: lee123abc
Date: November 2, 2009 at 00:42:19 Pacific
Reply:

Thank you Razor2.3, exactly what I wanted.

How do you write your answers in a different font?


0

Response Number 5
Name: Mechanix2Go
Date: November 2, 2009 at 01:22:33 Pacific
Reply:

Look at the html for this page.

In firefox: ctrl-u


=====================================
Helping others achieve escape felicity

M2


0

Related Posts

See More



Response Number 6
Name: lee123abc
Date: November 2, 2009 at 01:26:54 Pacific
Reply:

Thanks M2 will do


0

Sponsored Link
Ads by Google
Reply to Message Icon





Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: get c:\ space

Passing an Open File in C++ www.computing.net/answers/programming/passing-an-open-file-in-c/17174.html

Want to learn C++ www.computing.net/answers/programming/want-to-learn-c/9123.html

calling c functions from java www.computing.net/answers/programming/calling-c-functions-from-java/2913.html