Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Need help with script  (Read 6656 times)

0 Members and 1 Guest are viewing this topic.

Salmon Trout

  • Guest
Re: Need help with script
« Reply #15 on: November 29, 2014, 04:49:40 AM »
I want to figure out how to do this

You misunderstood my question. What business or other task do you have that needs this?

edwis1345

    Topic Starter


    Rookie

    Thanked: 1
    • Experience: Beginner
    • OS: Windows 7
    Re: Need help with script
    « Reply #16 on: November 29, 2014, 07:25:23 AM »
    Anyone can help me with this? I need to run proccesses listed in .txt file if they are killed.
    @echo off
    @echo off &setlocal enabledelayedexpansion
    tasklist /fo list|find /i ".exe">%temp%\running.tmp
    for /f "tokens=2*" %%a in (%temp%\running.tmp) do (
    call :process %%b
    )
    pause

    exit /b

    :process
    for /f "tokens=*" %%c in (sarasas.txt) do if "%*"=="%%c" (
    set Answ=N
    echo Isjungti procesa?
    set /p Answ=Isjungti? %*?
    IF /I NOT "!Answ!"=="Y" GOTO :EOF
    if errorlevel 1 goto :EOF
    echo Killing %%c
    taskkill /f /im "%%c"


    )


    foxidrive



      Specialist
    • Thanked: 268
    • Experience: Experienced
    • OS: Windows 8
    Re: Need help with script
    « Reply #17 on: November 29, 2014, 11:36:15 PM »
    Anyone can help me with this?

    People that help in forums like this generally do so because they like coding,
    and understanding why a task is being performed gives them some satisfaction -
    and if you answer their questions then they will probably bend over backwards to help you.

    A second benefit of discussing the tasks properly is that these helpers will often use their experience and knowledge to
    give you a robust script that also works in situations that you hadn't yet considered.