-4

is it possible to add (Free)Diskspace to C: with a batch script?

Nirispa
  • 53
  • 1
  • 1
  • 8
  • I wonder, where the additional space should come from (I'm sure `del /s *.*` isn't an option). Do you think of something like [this](https://technet.microsoft.com/de-de/library/cc753321(v=ws.11).aspx)? – Stephan Nov 23 '17 at 10:41
  • Or are you asking how to get the amount of free disk space? If so, try [this](https://stackoverflow.com/questions/17255925/windows-batch-file-to-get-c-drive-total-space-and-free-space-available) and [this](https://stackoverflow.com/questions/13106997/how-to-get-integer-of-free-disk-space-in-batch-file). – DodgyCodeException Nov 23 '17 at 11:05

2 Answers2

0

You could write a script which deletes the most common places of temp files and caches on your system in order to free up space. Creating space out of nowhere is not possible though, obviously. If you do not need to automate the cleanup, you are probably better off using some cleanup tool for windows, simply google for "cleanup tool windows" for example.

If you want identify the most bloated places on your system, i found it very useful to use a tool showing you a sunburst diagram of places taking the most space on your hard drive. Such a tool would be f.i. http://www.jgoodies.com/freeware/jdiskreport/

If you are talking about resizing a partition, see e.g. https://www.partition-tool.com/resource/expand-windows-7-partition.htm for non automated options or http://www.itprotoday.com/management-mobility/formatting-and-resizing-partitions-diskpart for being able to do that in a batch file

Magnus Lutz
  • 558
  • 3
  • 12
0

yes you can extend Partition size using script but with Precaution

there are many tools available for doing the same task safely but since you asked

Check Few Examples before proceeding.

Diskpart Scripts and Examples - Microsoft

User input for a DISKPART batch file

Extend a Basic Volume and Increase Disk Space

(for example)

Manually Check First (use with caution)

  1. open cmd and input diskpart
  2. Now when in Diskpart window
  3. Input below commands

list volume - This will list all your volumes/partitions

select volume n - This will select your volume to resize/extend n will be your volume number

extend size=10240 - you need to input your desired size to be added to selected volume

10240=10GB

Gourav
  • 116
  • 1
  • 6