/build/static/layout/Breadcrumb_cap_w.png

read bat file script

Please help to understand to read below code. I got it in a very big lengthy bat file, which uninstalls and installs symantec antivirus. I have to create vbscript, for it. "For /f, tokens=2", this is something difficult to understand.


verify>nul
tasklist | find /i "SMC.EXE" > "%windir%\system32\SEP_Migrate\Sygate_Uninstall\SMC_PID.txt"
FOR /F "tokens=2" %%R IN ('TYPE "%windir%\system32\SEP_Migrate\Sygate_Uninstall\SMC_PID.txt"') DO SET SMC_ID=%%R
call "%windir%\system32\SEP_Migrate\launcher_drwtsn_kill.bat.vbs"
::start "%windir%\system32\SEP_Migrate\drwtsn_kill.bat"
drwtsn32 -p %SMC_ID%

0 Comments   [ + ] Show comments

Answers (1)

Posted by: abking99 15 years ago
Second Degree Blue Belt
0
I think I got it.
http://ss64.com/nt/for_f.html
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ