Here’s something that I always do when writing any sort of Flex Application. I’ll write a batch file that would allow me to quickly double click it and copy all of the files on the bin-release folder to the production server. This normally save me a lot of time as I don’t have to manually look for the files and copy them to the server.
Here’s a quick way to create the batch file and edit it to do what you want to ,
- Open up Notepad in Windows. You can do this by navigating to Start > Programs > Accessories > Notepad, or simply by entering notepad under Start > Run.
- Save your file before you start writing any code
- Go to File > Save As.
- Click on the dropdown box “Save as type:” and select “All files” instead of Text (*.txt).
- Add .bat to the end of your file name before you save. For example copy.bat.
- Click on Save.
Now a little batch commands to delete the files that exist on the production server first before we copy the files from the bin-release folder to the production server followed by opening the page using the default browser.
1 2 3 4 5 6 | REM Delete old production files del \\production_server_name\production_folder\*.* REM Copy over new production files copy *.* \\production_server_name\production_folder\ REM Open the location of the file using default browser start www.production_server.com |
The batch file should be located in the same folder as the files that you want to copy
