Jump to content

Taskkill and batch cmd


Recommended Posts

Hi :hello:

I need a little help with taskkill and advanced batch file.

Want i want to do in my batch (lauching during runoncex.cmd; 1st logon) is:

1. deleting some reg keys (no pb with this)

2. executing launch of ms outlook express (msimn.exe)

3. killing msimn.exe task

4. writing some entry in registry

5. end of batch

Her's my actual method, eveything is ok excepting step 3 (killing msimn.exe).

runonceex:

REG ADD %KEY%\014 /VE /D "Configuration de Outlook Express" /f

REG ADD %KEY%\014 /V 1 /D "%cdrom%\SETUP\SOFT\outlook.cmd" /f

outlook.cmd

@echo off

set outlook="%SystemDrive%\Program Files\Outlook Express"

Echo Step1

REG DELETE "HKCU\Identities" /f

Echo Step2

%outlook%\msimn.exe

Echo Step3

taskkill /F /IM msimn.exe

Echo Step4

for /f "Tokens=5" %%i in ('REG QUERY HKCU\Identities /v "Default User ID"^|find "Default"') do set default_identity=%%i

REG ADD "HKCU\Identities\%default_identity%\Software\Microsoft\Outlook Express\5.0" /v "Browser Bands" /t REG_BINARY /d 1100000004000000640000008002000064000000660000000200000016000000650000000102000064000000670000000900

000064000000 /f

REG ADD "HKCU\Identities\%default_identity%\Software\Microsoft\Outlook Express\5.0" /v "BrowserPos" /t REG_BINARY /d 2C0000000200000003000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8000000068000000800300007A020000 /f

REG ADD "HKCU\Identities\%default_identity%\Software\Microsoft\Outlook Express\5.0" /v "Expand Unread" /t REG_DWORD /d 00000001 /f

REG ADD "HKCU\Identities\%default_identity%\Software\Microsoft\Outlook Express\5.0" /v "Launch Inbox" /t REG_DWORD /d 00000001 /f

REG ADD "HKCU\Identities\%default_identity%\Software\Microsoft\Outlook Express\5.0" /v "Nav Pane Split" /t REG_DWORD /d 00000032 /f

REG ADD "HKCU\Identities\%default_identity%\Software\Microsoft\Outlook Express\5.0" /v "Nav Pane Width" /t REG_DWORD /d 00000306 /f

REG ADD "HKCU\Identities\%default_identity%\Software\Microsoft\Outlook Express\5.0" /v "Show Contacts" /t REG_DWORD /d 00000001 /f

REG ADD "HKCU\Identities\%default_identity%\Software\Microsoft\Outlook Express\5.0" /v "Show Deleted Messages" /t REG_DWORD /d 00000001 /f

REG ADD "HKCU\Identities\%default_identity%\Software\Microsoft\Outlook Express\5.0" /v "ShowStatus" /t REG_DWORD /d 00000001 /f

REG ADD "HKCU\Identities\%default_identity%\Software\Microsoft\Outlook Express\5.0" /v "ShowToolbarIEAK" /t REG_DWORD /d 00000001 /f

REG ADD "HKCU\Identities\%default_identity%\Software\Microsoft\Outlook Express\5.0" /v "Toolbar Icon Size" /t REG_DWORD /d 00000001 /f

REG ADD "HKCU\Identities\%default_identity%\Software\Microsoft\Outlook Express\5.0" /v "Toolbar Text" /t REG_DWORD /d 00000004 /f

REG ADD "HKCU\Identities\%default_identity%\Software\Microsoft\Outlook Express\5.0\Mail" /v "Accounts Checked" /t REG_DWORD /d 00000001 /f

REG ADD "HKCU\Identities\%default_identity%\Software\Microsoft\Outlook Express\5.0\Mail" /v "Block External Content" /t REG_DWORD /d 00000000 /f

REG ADD "HKCU\Identities\%default_identity%\Software\Microsoft\Outlook Express\5.0\Mail" /v "Check Mail on Startup" /t REG_DWORD /d 00000001 /f

REG ADD "HKCU\Identities\%default_identity%\Software\Microsoft\Outlook Express\5.0\Mail" /v "Safe Attachments" /t REG_DWORD /d 00000000 /f

REG ADD "HKCU\Identities\%default_identity%\Software\Microsoft\Outlook Express\5.0\Mail" /v "Secure Safe Attachments" /t REG_DWORD /d 00000001 /f

REG ADD "HKCU\Identities\%default_identity%\Software\Microsoft\Outlook Express\5.0\Mail" /v "SplitHorzPct" /t REG_DWORD /d 00000032 /f

REG ADD "HKCU\Identities\%default_identity%\Software\Microsoft\Outlook Express\5.0\Mail" /v "Warn on Mapi Send" /t REG_DWORD /d 00000001 /f

REG ADD "HKCU\Identities\%default_identity%\Software\Microsoft\Outlook Express\5.0\Mail" /v "Welcome Message" /t REG_DWORD /d 00000000 /f

Echo Step5

exit

Echo step "n" is not in my real batch just put this here for a better reading of my batch.

My problem is with "step2 & 3" outlook is launch, but wait until i close it myself, so step 3 is not execute "properly" (and so step 3 is unusefull!), so how to launch OE AND after a few second closing OE automatically into the same batch ???

I tried something like "msimn.exe && taskkill /F /IM msimn.exe" but this don't work... OE is open and wait for "human click"...

Any idea ?

Link to comment
Share on other sites


Thanks a lot Sonic, reaaaally appreciated your help ! This is exactly what I was looking for :w00t:

set outlook="%SystemDrive%\"Program Files\Outlook Express""

start "" "%outlook%\msimn.exe"

taskkill /F /IM msimn.exe

Edited by cyberyeye
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
  • Recently Browsing   0 members

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