VB icon

Autorun Generator

Email
Submitted on: 1/4/2015 4:02:00 AM
By: Jesse White (from psc cd)  
Level: Beginner
User Rating: By 4 Users
Compatibility: C++ (general), Borland C++
Views: 1964
 
     Generates a autorun.inf

 

INCLUDE files:

Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
//**************************************
//INCLUDE files for :Autorun Generator
//**************************************
fstream.h
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
				
//**************************************
// Name: Autorun Generator
// Description:Generates a autorun.inf
// By: Jesse White (from psc cd)
//
// Inputs:filename
//**************************************

#include <fstream.h>
int main()
{
char filename[80];
cout <<" Welcome To Autorun Maker 1.0 \n \n";
cout <<" Please enter the file name you would like to make autorun\n";
cout <<" ::";
cin.get(filename,79);
ofstream file;//creates an ofstream object
 
file.open("autorun.inf"); //creates the autorun.inf file and opens it for writing
file<<"[autorun]\n"; //writes to the file
file<<"open="<<filename<<"\n";
file.close();
 return 0;
}


Other 1 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

7/6/2015 6:36:51 AMshane

Hello. this did not compile, the includes and namespace had to be changed. this is my code that compiled in the latest version of DEVC++

#include
#include
using namespace std;
int main()
{
char filename[80];
cout <<" Welcome To Autorun Maker 1.0 \n \n";
cout <<" Please enter the file name you would like to make autorun\n";
cout <<" ::";
cin.get(filename,79);
ofstream file;//creates an ofstream object

file.open("autorun.inf"); //creates the autorun.inf file and opens it for writing
file<<"[autorun]\n"; //writes to the file
file<<"open="<file.close();
return 0;
}
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.