Get and use computer name?

I know multiple ways of getting the computer’s name on ruby and the one
I use is

ENV[“COMPUTERNAME”]

Here is my question.
How to practically use it?

When changing directory to desktop or certain directories you will need
the computer’s name and I don’t like typing my pc’s name every time. Is
there a solution to this?

I tried finding the answer to my question every where but I couldn’t.

Thanks.

I didn’t realise you needed the computer’s name to get to the desktop,
what OS are you using?

On Windows I just use
ENV[‘HOME’] + ‘/Desktop’

Joel P. wrote in post #1136413:

I didn’t realise you needed the computer’s name to get to the desktop,
Huh? You serious?

Thanks it helped.

Maybe you didn’t used the “C:\users\computername\desktop” because
ENV[‘HOME’] already holds it.

It’s the user name, not the computer name :slight_smile: