I have created a batch file which automatically copy a .sql file to the path of installed Jasper server(it could be any software installation directory).
This is my batch script--
C:\PROGRA~2\JASPER~1.0\mysql\bin\mysql.exe -u root -proot < create_database.sql
that is working when jasper is installed in Program Files(x86). How can i generalize it for both Program Files and Program Files(x86).
To create a Windows batch file, follow these steps: Open a text file, such as a Notepad or WordPad document. Add your commands, starting with @echo [off], followed by, each in a new line, title [title of your batch script], echo [first line], and pause. Save your file with the file extension BAT, for example, test.
While in the command prompt type "cd\", then enter. From there type "cd\program" then hit the tab button until you see "c:\program files (x86)", then hit enter.
It doesn't normally matter whether a program's files are stored in Program Files or Program Files (x86). Windows automatically installs programs to the correct folder, so you don't have to think about it. Programs appear in the Start menu and function normally, no matter where they're installed.
Here is how I do it:
GOTO %PROCESSOR_ARCHITECTURE%
:AMD64
<64Bit code>
EXIT
:X86
<32bit code>
EXIT
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With