Discussion forum for all Windows batch related topics.
Moderator: DosItHelp
-
ytyyutianyun
- Posts: 3
- Joined: 01 Feb 2013 04:26
#1
Post
by ytyyutianyun » 01 Feb 2013 04:34
os windows7 64
the bat is in E:\key and the *.key also
And I want to batch to try if this key is okey.
But I found An error has occurred and the application will close immediately.
Then,help and Thank you
MY bat is
Code: Select all
@echo off
for /f %%i in ('dir /a-d /b *.key') do (
path "C:\Program Files (x86)\Kaspersky Lab\Kaspersky Internet Security 2012";%PATH%
avp.com addkey %%i
del /q %%i
pause
goto :EOF
)
Last edited by
ytyyutianyun on 01 Feb 2013 07:34, edited 1 time in total.
-
foxidrive
- Expert
- Posts: 6031
- Joined: 10 Feb 2012 02:20
#2
Post
by foxidrive » 01 Feb 2013 05:59
Try this: I'm assuming your command is correct.
Is the key name a short filename?
Code: Select all
@echo off
cd /d "e:\"
for /f %%i in ('dir /a-d /b *.key') do (
"C:\Program Files (x86)\Kaspersky Lab\Kaspersky Internet Security 2012\avp.com" addkey %%i
del /q %%i
pause
goto :EOF
)
-
ytyyutianyun
- Posts: 3
- Joined: 01 Feb 2013 04:26
#3
Post
by ytyyutianyun » 01 Feb 2013 07:21
foxidrive wrote:Try this: I'm assuming your command is correct.
Is the key name a short filename?
Code: Select all
@echo off
cd /d "e:\"
for /f %%i in ('dir /a-d /b *.key') do (
"C:\Program Files (x86)\Kaspersky Lab\Kaspersky Internet Security 2012\avp.com" addkey %%i
del /q %%i
pause
goto :EOF
)
Thank you for you answer
1. the key name is like "KIS2010(en)-2013.04.04(365)-06826876"
2. I run you code and the application also close immediately. Then I run the CMD and get the information
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\yuyuxuan>D:\KeyChecker\kaba.bat
File Not Found
d:\>
A
-
ytyyutianyun
- Posts: 3
- Joined: 01 Feb 2013 04:26
#4
Post
by ytyyutianyun » 01 Feb 2013 07:33
Great, You are too smart
Code: Select all
@echo off
cd /d "D:\KeyChecker"
for /f %%i in ('dir /a-d /b *.key') do (
"C:\Program Files (x86)\Kaspersky Lab\Kaspersky Internet Security 2012\avp.com" addkey %%i
del /q %%i
pause
goto :EOF
)
And it did.
Thank you