How to start XAMPP-VM by command line? - xampp-vm

I'm using
I need to write a shell script to automatically start XAMPP-VM, Apache, and MySQL.
How can I start XAMPP-VM by a command line?

View /Applications/XAMPP/xamppfiles/ctlscript.sh, you could see all logic of scripts which control XAMPP's services by shell script.

Related

Run a script to load commands into my main script

I have a powershell file that I have downloaded from ScriptCenter that allows me to control and query virtual desktops on my machine (https://gallery.technet.microsoft.com/scriptcenter/Powershell-commands-to-d0e79cc5).
Using their example, I can run that ps1 file at the start of my script to use those commands that the script creates. All fine here.
The only issue with this is that when I run my script, it asks to confirm to run it. This is something I don't want my script to do.
To work around this, I tried using the "PowerShell" command with "-ExecutionPolicy Bypass" set. This removes the prompt to approve the script, however it stops the script from being loaded into my scripts session as I can't use any of the commands it make available by running it.
How do I either run the script first, without it prompting, or execute the powershell command so that it is run in the session space of my script so that its commands are available?
Thanks

Load script command on windows not working

Trying to run an orientdb script from the command line using:
console.bat then the script name e.g. console.bat myscript.osql.
When I run the command I get an error
!Unrecognized command: '?select from TestClass' (TestClass isnt the real class but it will do).
If I run the commands manually on the console they work as I would expect.
I am on windows 10 creators edition, orientdb 2.2.30.
Assuming you're connected to your database and your script is in the same directory as console.bat (bin), you should execute LOAD SCRIPT myscript.osql to properly load it.
See LOAD SCRIPT from the docs.

perl command prompt with arguments

Is it possible to start a command prompt from perl script using Win32::Process::Create package?
I am trying to start DOORS from perl script. The executable is present in C:\Program Files\DOORS\bin\runDOORS9.rck.
I need to start the runDOORS9.rck with the argument COL9 to change the Database.
Try the good old system() function. On Windows it would use the cmd.exe, the system shell, to execute the command.
Since what you try to launch doesn't seem to be an .exe file, potentially you would have to use the start command of the cmd.exe.
For example:
system(qq{start "" "C:\Program Files\DOORS\bin\runDOORS9.rck" COL9});
(The first "" is required due to quirky argument parsing of the Window's shell commands. See help start for more information.)

DB2 executing a Script in another Script

I am facing a problem in DB2. In my Oracle environment it was very easy for me to include multiple scripts in one master script, which were executed sequentially. e.g.:
Master.sql:
connect ....
#script1.sql
#script2.sql
Now I have to build up same logic in DB2 LUW. Is there a simple way to include multiple scripts in one master script? I would like to have one single db2 call from shell, which executes the master script and within all subscripts.
Regards
Jan
There is notrhing to stop you from creating a single file with multiple sql batches. In the Windows world, it would look like this:
Note: First you initialize the db2 command prompt.
db2cmd -c -w -i %1.bat
With as many of these as you want in the .bat file:
db2 -txf c:\Example\db2html.sql
In Linux, the db2clp is included in the shell once you load the db2profile ('. /home/db2inst1/sqllib/db2profile). In windows, you need to call db2cmd in order to use db2clp.
With a interactive db2clp, you cannot call db2 scripts via #scriptX, however, you can call them from the shell like
db2 -tvf script
However, if you use the CLP*Plus you can do almost everything you do in SQL*Plus. For more information: https://www.ibm.com/developerworks/community/blogs/IMSupport/entry/tech_tip_db2_s_new_clp_plus_utility?lang=en

invoking commands on Unix from Windows power shell

Is this possible ?, someone has suggested that I migth be able to do via ssh, essentially run a command on Unix pipe the output to a file get it back and then perform some action in the invoking Power Shell script.
Well, you can use tools like plink to execute a command via ssh on a remote server. Also you don't need to write the result to a file; you can simply assign it to a variable:
$output = plink ...
With Win32-OpenSSH you can execute commands over SSH. See Win32-OpenSSH Examples.
It is possible!
Have a look at this GitHub repository for all of the UNIX commands that have been compiled to run on Windows. Then, you can run both PowerShell and UNIX commands from PowerShell.