Newby question: I installed Rust on Windows 8.1. But I'm new at Powershell and can't get my Hello World to compile:
(1) Windows added a .txt extension onto my main.rs file. I can't find an option to remove the .txt in Windows Explorer, and in Powershell, get "Rename-Item : Access to the path is denied" -- even after I changed the folder permissions.
(2) Also, I can't run rustc at all. I get, "The term 'rustc' is not recognized as the name of a cmdlet, function, ..." I've set the Location to my project directory; do I also need to put something into a pathname?
in windows explorer, make sure 'File name extension' is checked in ribbon tab 'view'.
So you can remove .txt from the filename.
Rust MSI installer don't automaticly put rustc & cargo bin folder to PATH variable.
When you install rust, make sure to select 'advance' and check options for something like 'add rust folder to PATH'
You can toggle visible file name extensions in Windows explorer like this
In order to invoke rustc or cargo from your terminal you need to add their location to your PATH. If you don't want to use the option in the installer to set your global PATH, then you can still set it temporarily for a given terminal. For example, if I installed Rust to C:\rust64-1.1.0, if I'm using cmd I would do SET PATH=%PATH%;C:\Rust64-1.1.0\bin; if I was using Powershell I would do $env:Path += ";C:\Rust64-1.1.0\bin".