cyberyeye Posted December 13, 2005 Share Posted December 13, 2005 Hi 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 task4. writing some entry in registry5. end of batchHer's my actual method, eveything is ok excepting step 3 (killing msimn.exe).runonceex:REG ADD %KEY%\014 /VE /D "Configuration de Outlook Express" /fREG ADD %KEY%\014 /V 1 /D "%cdrom%\SETUP\SOFT\outlook.cmd" /foutlook.cmd@echo offset outlook="%SystemDrive%\Program Files\Outlook Express"Echo Step1REG DELETE "HKCU\Identities" /fEcho Step2%outlook%\msimn.exeEcho Step3taskkill /F /IM msimn.exeEcho Step4for /f "Tokens=5" %%i in ('REG QUERY HKCU\Identities /v "Default User ID"^|find "Default"') do set default_identity=%%iREG ADD "HKCU\Identities\%default_identity%\Software\Microsoft\Outlook Express\5.0" /v "Browser Bands" /t REG_BINARY /d 1100000004000000640000008002000064000000660000000200000016000000650000000102000064000000670000000900000064000000 /fREG ADD "HKCU\Identities\%default_identity%\Software\Microsoft\Outlook Express\5.0" /v "BrowserPos" /t REG_BINARY /d 2C0000000200000003000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8000000068000000800300007A020000 /fREG ADD "HKCU\Identities\%default_identity%\Software\Microsoft\Outlook Express\5.0" /v "Expand Unread" /t REG_DWORD /d 00000001 /fREG ADD "HKCU\Identities\%default_identity%\Software\Microsoft\Outlook Express\5.0" /v "Launch Inbox" /t REG_DWORD /d 00000001 /fREG ADD "HKCU\Identities\%default_identity%\Software\Microsoft\Outlook Express\5.0" /v "Nav Pane Split" /t REG_DWORD /d 00000032 /fREG ADD "HKCU\Identities\%default_identity%\Software\Microsoft\Outlook Express\5.0" /v "Nav Pane Width" /t REG_DWORD /d 00000306 /fREG ADD "HKCU\Identities\%default_identity%\Software\Microsoft\Outlook Express\5.0" /v "Show Contacts" /t REG_DWORD /d 00000001 /fREG ADD "HKCU\Identities\%default_identity%\Software\Microsoft\Outlook Express\5.0" /v "Show Deleted Messages" /t REG_DWORD /d 00000001 /fREG ADD "HKCU\Identities\%default_identity%\Software\Microsoft\Outlook Express\5.0" /v "ShowStatus" /t REG_DWORD /d 00000001 /fREG ADD "HKCU\Identities\%default_identity%\Software\Microsoft\Outlook Express\5.0" /v "ShowToolbarIEAK" /t REG_DWORD /d 00000001 /fREG ADD "HKCU\Identities\%default_identity%\Software\Microsoft\Outlook Express\5.0" /v "Toolbar Icon Size" /t REG_DWORD /d 00000001 /fREG ADD "HKCU\Identities\%default_identity%\Software\Microsoft\Outlook Express\5.0" /v "Toolbar Text" /t REG_DWORD /d 00000004 /fREG ADD "HKCU\Identities\%default_identity%\Software\Microsoft\Outlook Express\5.0\Mail" /v "Accounts Checked" /t REG_DWORD /d 00000001 /fREG ADD "HKCU\Identities\%default_identity%\Software\Microsoft\Outlook Express\5.0\Mail" /v "Block External Content" /t REG_DWORD /d 00000000 /fREG ADD "HKCU\Identities\%default_identity%\Software\Microsoft\Outlook Express\5.0\Mail" /v "Check Mail on Startup" /t REG_DWORD /d 00000001 /fREG ADD "HKCU\Identities\%default_identity%\Software\Microsoft\Outlook Express\5.0\Mail" /v "Safe Attachments" /t REG_DWORD /d 00000000 /fREG ADD "HKCU\Identities\%default_identity%\Software\Microsoft\Outlook Express\5.0\Mail" /v "Secure Safe Attachments" /t REG_DWORD /d 00000001 /fREG ADD "HKCU\Identities\%default_identity%\Software\Microsoft\Outlook Express\5.0\Mail" /v "SplitHorzPct" /t REG_DWORD /d 00000032 /fREG ADD "HKCU\Identities\%default_identity%\Software\Microsoft\Outlook Express\5.0\Mail" /v "Warn on Mapi Send" /t REG_DWORD /d 00000001 /fREG ADD "HKCU\Identities\%default_identity%\Software\Microsoft\Outlook Express\5.0\Mail" /v "Welcome Message" /t REG_DWORD /d 00000000 /fEcho Step5exitEcho 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 More sharing options...
Sonic Posted December 13, 2005 Share Posted December 13, 2005 You must use START ...start "" "C:\Program Files\Outlook Express\msimn.exe"++ Link to comment Share on other sites More sharing options...
cyberyeye Posted December 14, 2005 Author Share Posted December 14, 2005 (edited) Thanks a lot Sonic, reaaaally appreciated your help ! This is exactly what I was looking for set outlook="%SystemDrive%\"Program Files\Outlook Express""start "" "%outlook%\msimn.exe"taskkill /F /IM msimn.exe Edited December 14, 2005 by cyberyeye Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now