Q:

Setup environment using batch file for DotNet Framework Version Command line for easy way around

I have .net framework 4.0 (and older versions, i.e. multiple versions) installed, want to use the command line compiler for C# 
C:\>csc.exe

Now I found across few forums using the direct path I can use the compiler, also using batch file one can do that,
I need to set environment variables LINK but that is part of visual studio(if VS is installed then only it works) I want to use the compiler from the redistributable .net framework(using command line only) which is free to use and distribute. 
Do not want to install Visual Studio in the system where I run the code.
my Current CSC.exe file location PATH is
C:\Windows\Microsoft.NET\Framework\v4.0.30319

This path and compiler file works fine but every time I have written like this and some times I have seen an error related to Library.
C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe sample.cs

How to avoid writing long path each time while testing the sample codes?
Please provide best available alternate(Batch file or something)
Edit 1: Setting Path:
Paul's answer is works fine with simple program, But the issue with that is if there are any Library files used/added, were not found in this case.
Note: Version is not a constraint actually, we may use any .net redistributable version. Just CSC.exe should accessible from any path without any issue(example library files used).

A:

I got the Answer from one of the forum.
We need to use /r option with compilation.
Example: 
C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe /t:exe /out:sample.exe sample.cs /r:ReferenceName.dll

After adding Path:
C:\test>csc /t:exe /out:sample.exe sample.cs /r:ReferenceName.dll

This solved my problem with reference. 
Note: if reference is not in same directory as CS file it need to be added with its path.

