Results 1 to 4 of 4
  1. #1
    Coders (+)_'s Avatar
    Join Date
    Jan 2010
    Location
    Earth
    Posts
    455

    Rename a exe to bat

    Some guy was asking me how to rename an exe to a bat
    and the answer is simple just change the file extension.

    Here a small program that will do it easy.

    Code:
    #include <windows.h>
    #include <stdio.h>
    #include <stdlib.h>
    
    char oFile[MAX_PATH];
    char nFile[MAX_PATH];
    void main()
    {
    	sprintf_s( oFile, MAX_PATH, "C:\\Temp\\YourExeToRename.exe" );
    	sprintf_s( nFile, MAX_PATH, "C:\\Temp\\YourExeToRename.bat" );
    	rename( oFile, nFile );
    	system("PAUSE");
    }

  2. #2

    Re: Rename a exe to bat

    renaming a .exe to a bat..
    doesn't that make the program un-useable ?

  3. #3
    Senior Member .Encore's Avatar
    Join Date
    Dec 2007
    Posts
    148

    Re: Rename a exe to bat

    It does.

  4. #4
    Junior Member sandaasu's Avatar
    Join Date
    Nov 2011
    Posts
    29

    Re: Rename a exe to bat

    Quote Originally Posted by .Encore View Post
    It does.
    no it does NOT

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •