locked
Desperately need a Script to safely start wamp. RRS feed

  • Question

  • I'm looking for a way to be sure it is not already running on some other machine before starting it.  The best way I've figured out is to check for an existing .pid in the <g class="gr_ gr_34 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="34" id="34">mysql</g> folder.  
    The easiest thing would be to modify the shortcut but I don't think <g class="gr_ gr_23 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="23" id="23">thats</g> possible afaik.
    <g class="gr_ gr_24 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del" data-gr-id="24" id="24">So <g class="gr_ gr_29 gr-alert gr_tiny gr_spell gr_inline_cards gr_disable_anim_appear ContextualSpelling multiReplace" data-gr-id="29" id="29">i</g></g> need to do a couple of things.

    1) figure out where <g class="gr_ gr_27 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="27" id="27">mysql</g> is stored

    2) check for <g class="gr_ gr_32 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins replaceWithoutSep" data-gr-id="32" id="32">existence</g> of a .pid file and if found throw a message box stating so with the name of the file MINUS the extension to give them a hint what machine is be running it.

    3) if not exist then go ahead and start wamp like it normally would with the shortcut.

    DONE.

    If necessary we can ask the user ONCE where <g class="gr_ gr_31 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="31" id="31">wamp</g> is stored then <g class="gr_ gr_35 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling" data-gr-id="35" id="35">its</g> simply at %wamp%\bin\mysql
    <g class="gr_ gr_36 gr-alert gr_tiny gr_spell gr_inline_cards gr_run_anim ContextualSpelling multiReplace" data-gr-id="36" id="36">i</g> tried this script but it doesn't do it properly, it's opening 2 cmd windows and just throwing a pause.


    @echo off
    cd "C:\google_drive\server\wamp64"
    forfiles /p bin\mysql\ /m *.pid /s /c "cmd /c goto error"
    start wampmanager.exe
    exit
    :error
    echo I'm sorry, Mysql is already running so I can't start WAMP for you. Shutdown WAMP on @FNAME before running again."
    pause

    all help will be greatly appreciated.

    Bear




    • Edited by Troy Hall Sunday, May 28, 2017 7:54 PM
    • Moved by Bill_Stewart Friday, July 7, 2017 6:54 PM Post filled with garbage strings/unanswerable
    Sunday, May 28, 2017 7:49 PM

All replies

  • You need to fix your post.  It is unreadable and full of junk characters.


    \_(ツ)_/

    Sunday, May 28, 2017 7:57 PM