Click here to Skip to main content
15,566,496 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am working with windows platform, i want to run notepad file with the help of C program. What i tried is here
void main()

The code has no errors but still am not able to see a new notepad file. Please help me out

Thanks & regards
Radix :rose:
Updated 2-Dec-19 4:14am

A simple executable like:

#include <stdlib>

int main()
    system( "notepad" );

works for me on VC++2005 and XP. If you open a command prompt as the same user you're running your C program as can you invoke notepad just by typing "notepad"?


Share this answer
Nish Nishant 16-Jul-10 11:22am    
Reason for my vote of 5
Worth 5. Not sure why someone 4d this.
radix3 19-Jul-10 10:14am    
I am using Turbo C and i tried the above code it's not working. I even wrote the full path of notepad but alas no success
I thought that ShellExecute was a C API, and not a C++ one.
Share this answer
radix3 16-Jul-10 8:17am    
Sir i didn't get you.can you please explain
I tried your code on my PC and it works properly. You specified the full-path of notepad: are you sure that it is correct?
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