Jump to content

Run a .bat file


Recommended Posts

Hi

I have a problem ,  if description not clearly , please bear with me, thanks.

I run a bat file and use command _RunDos(@ScriptDir & "\HLK_Filter.bat") 

But will show "press any key to continue" the end (this information is bat file default setting.... )

I want to know , May I use auto it command for this instruction and close command window.......

 

 

Link to comment
Share on other sites

Hi All

My batch script is there 

@echo off
:: Filter updater for HCK and HLK
:::::::::::::::::::::::::: Settings :::::::::::::::::::::::::::::::::
:: Notice: As of July 2015, the HCK and the HLK filter updates are the exact same file, downloaded from the same location!
SET "source=https://sysdev.microsoft.com/member/SubmissionWizard/LegalExemptions/HCKFilterUpdates.cab"

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

SET "destination=C:\FilterUpdates.cab"

if not exist "%DTMBIN%\" (
    echo ERROR: folder "%DTMBIN%"
    echo does not exist! Please verify that you have the controller installed.
    exit /B 1
)

echo Please make sure that all instances of the Studio are turned OFF!


echo Downloading Filters...
bitsadmin /transfer "Downloading Filters" "%source%" "%destination%"
if not errorlevel 0 echo ERROR & exit /B 1
echo Extracting...
expand -i "%destination%" -f:UpdateFilters.sql "%DTMBIN%\"
if not errorlevel 0 echo ERROR & exit /B 1
echo Installing...
pushd "%DTMBIN%\"
if not errorlevel 0 echo ERROR & exit /B 1
"%DTMBIN%\updatefilters.exe"
if not errorlevel 0 echo ERROR & exit /B 1
popd

Link to comment
Share on other sites

You could try something like this:
nb: You'll need to update the $DTMBIN variable folder path

#include <InetConstants.au3>
    Local $DTMBIN = ''
    Local $sFilePath = "C:\FilterUpdates.cab"

    ; Download the file in the background with the selected option of 'force a reload from the remote site.'
    Local $hDownload = InetGet("https://sysdev.microsoft.com/member/SubmissionWizard/LegalExemptions/HCKFilterUpdates.cab", $sFilePath, $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND)

    Do
        Sleep(250)
    Until InetGetInfo($hDownload, $INET_DOWNLOADCOMPLETE)

    ; Close the handle returned by InetGet.
    InetClose($hDownload)
    RunWait(@ComSpec & ' /c expand -i "' & $sFilePath & '" -f:UpdateFilters.sql "' & $DTMBIN & '"', '', @SW_HIDE)
    RunWait($DTMBIN & '\UpdateFilters.exe', '', @SW_HIDE)
    MsgBox(0,'', 'Finished')

 

Link to comment
Share on other sites

49 minutes ago, JeffQOOQAAA said:

@Subz

You can refer attachment

"press any key to continue"  is Applying updateFilte.sql default the end.

I want to use this bat file and the end  use autoit send key.......

 

Why did you take a picture using your phone....? There is a "Print Screen" button on your keyboard, or use the snipping tool lol

Edited by InunoTaishou
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...