0

I'm developing an application and I want to justify why I changed the location of some files from "c:\" to "%temp%". I think the best reason would be that not all windows computers have the "C:" drive. Is that true?

  • 1
    If your asking if a system can boot off a different drive letter the question is of course it can. Its just typically done. You should be able to justify using %temp% for the simple fact, it will always be correct, because its a system varible and hard coding the path is a horrible idea. – Ramhound Oct 8 '13 at 12:48
  • @Ramhound I know that it's possible to boot to D:. I want to know if it's possible to not have C: at all. – Jader Dias Oct 8 '13 at 12:53
  • Of course. You would be fighting default behavior but its entirely possible to change the boot drive to D then all other drives to something other then C – Ramhound Oct 8 '13 at 12:55
  • 2
    Yes, it is quite possible. You can even get to a windows installation with only drive F:\ by accident. Been there, got the T-shirt. Cursed a lot of programs which did not work due to bad coding. – Hennes Oct 8 '13 at 13:30
  • I think the important thing is that applications should use whatever is specified in the tmp or temp environment variable and allow the user to decide what is there. The existence or absence of the C drive seems irrelevant. – user34660 Jul 19 '19 at 20:51
2

Yes, its true! Windows location could be in any letter drive. Even because you can have more than one OS installed in the same computer.

You also could have a computer without C: driver letter.

You can look to others Environment Variables.

| improve this answer | |
  • The files are temporary, and I want to know if it's possible for that drive to not exist, not if windows would be installed to it or not. – Jader Dias Oct 8 '13 at 12:52
  • @JaderDias Okay! So no problem to install in temp folder. Answer edited! The Answer still the same you can't fix in C: driver folder. – Butzke Oct 8 '13 at 12:56
2

It is true that you can have another name for the Windows home drive. However, you can use %HOMEDRIVE% or %PROGRAMDATA% to find out where to put your files.

Windows has many other environment variables.

| improve this answer | |
  • But if Windows home drive is D:, it happens only when we have a C: drive? Can we make a Windows installation without C:? – Jader Dias Oct 8 '13 at 12:54
  • @JaderDias Yes you can make a installation without C! – Butzke Oct 8 '13 at 12:59
  • @JaderDias the idea is to rely on the environment variables instead of a hard path. – Spack Oct 8 '13 at 13:07
1

Regardless of whether there can be a Windows installation without a C:, there definitely can be a Windows installation with a C: where you can't write, for example because there's no directory on that drive where your application has write permission, or because that drive is full.

If you need to create temporary files, create them in the directory indicated by the TEMP environment variable (i.e. %TEMP%).

| improve this answer | |
1

Yes, its true!

C Drive its not essential for a computer. You can have one just with D: drive for example.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.