Click here to Skip to main content
15,877,754 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I want to compile .cs file MS-DOS.

I have set path variable. set path="c:\Program Files\Microsoft Visual Studio 10.0\VC"

But when I use csc D:\sample.cs, it is showing
'csc' is not recognized as an internal or external command,
operable program or batch file.


Please help.

Thanks in advance
Posted
Updated 29-Nov-13 0:26am
v2

Please try this:

1. Go to this location in your command prompt
C:\Windows\winsxs\x86_netfx35linq-csharp_31bf3856ad364e35_6.1.7601.17514_none_193318f5726bf1d7
2. Now execute following command:
csc [FullPath of your .cs file]

Hope this helps..
 
Share this answer
 
Comments
srmohanr 29-Nov-13 8:05am    
Thanks for your help.
I have done the same and execute it. But I got

error CS1619: Cannot create temporary file
'c:\Windows\winsxs\x86_netfx35linq-csharp_31bf3856ad364e35_6.1.7601.1751
4_none_193318f5726bf1d7\CSC8224.tmp' -- Access is denied.
That's because CSC.EXE is not in that directory.
Instead, try looking in:
C:\Windows\Microsoft.NET\Framework\v4.0.30319
or similar.
 
Share this answer
 
Comments
srmohanr 29-Nov-13 8:07am    
Thank you, it works for me.
OriginalGriff 29-Nov-13 8:23am    
You're welcome!
srmohanr 3-Dec-13 23:36pm    
Hi, I need one more help. How to run this compiled file?
Please tell me the command for it
OriginalGriff 4-Dec-13 5:34am    
Type it's name... :laugh:
Change path to this

C:\Windows\Microsoft.NET\Framework64\v2.0.50727 //Base 64 bit Os

C:\Windows\Microsoft.NET\Framework\v2.0.50727 //Base 32 bit Os
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900