create an executable with a file....
Posted: 27 Oct 2011 09:12
Hi I created a batch to give to a user that will basically go in and replace a file with the one I am providing. The file name will always remain the same, only that the one I provide will have necessary information. I want to convert this batch to an executable and include the file that the batch calls to change. The problem I am having is what changes do I need to do to the batch file so that it grabs the attached file I want to give. I dont want to send the users a batch and then tell them to for example specifically put a folder on their desktop. I just want to send it so they only have to double click on the icon and done. Here is my code:
@echo off
REM Used to create a backup of the original host file and copy in the new one
icacls C:\Windows\System32\drivers\etc\hosts /grant User:(F)
REM Creating a backup of the original host file
ren C:\Windows\System32\drivers\etc\hosts hostsbk
REM Here I want to copy the file over to the specified location.
xcopy "%USERPROFILE%\Desktop\Test\hosts" C:\Windows\System32\drivers\etc\ /y
icacls C:\Windows\System32\drivers\etc\hosts /grant User:(R)
Pause
I am using bat_to_exe converter
Thanks in advance.
@echo off
REM Used to create a backup of the original host file and copy in the new one
icacls C:\Windows\System32\drivers\etc\hosts /grant User:(F)
REM Creating a backup of the original host file
ren C:\Windows\System32\drivers\etc\hosts hostsbk
REM Here I want to copy the file over to the specified location.
xcopy "%USERPROFILE%\Desktop\Test\hosts" C:\Windows\System32\drivers\etc\ /y
icacls C:\Windows\System32\drivers\etc\hosts /grant User:(R)
Pause
I am using bat_to_exe converter
Thanks in advance.