id: 51bdd640899b444499cca9cf284e0997
parent_id: 
item_type: 1
item_id: 70934a4d89844baaadbbafc2762facd8
item_updated_time: 1764345570720
title_diff: "[{\"diffs\":[[1,\"当windows7网络断开或者连接时自动执行特定程序的方法-Windows 7教程-中琅软\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":45}]"
body_diff: "[{\"diffs\":[[1,\"<html>\\\r\\\n<head>\\\r\\\n  <title>当windows7网络断开或者连接时自动执行特定程序的方法-Windows 7教程-中琅软件教程网</title>\\\r\\\n  <basefont face=\\\"微软雅黑\\\" size=\\\"2\\\" />\\\r\\\n  <meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html;charset=utf-8\\\" />\\\r\\\n  <meta name=\\\"exporter-version\\\" content=\\\"YXBJ Windows/608924 (zh-CN, DDL); Windows/10.0.0 (Win64); EDAMVersion=V2;\\\"/>\\\r\\\n  <style>\\\r\\\n\\tbody, td {\\\r\\\n\\t  font-family: 微软雅黑;\\\r\\\n\\t  font-size: 12pt;\\\r\\\n\\t}\\\r\\\n  </style>\\\r\\\n</head>\\\r\\\n<body>\\\r\\\n<a name=\\\"11475\\\"></a>\\\r\\\n<h1>当windows7网络断开或者连接时自动执行特定程序的方法-Windows 7教程-中琅软件教程网</h1>\\\r\\\n\\\r\\\n<div><span><div style=\\\"-evernote-webclip:true\\\"><br/><div><div><div><div><h1>当windows7网络断开或者连接时自动执行特定程序的方法</h1><div><div></div></div></div>\\\n        <div>\\\n        \\t[日期：2013-02-21]\\\n            作者：\\\n            来源：\\\n            [字体：<a href=\\\"#\\\" target=\\\"_blank\\\">大</a> <a href=\\\"#\\\" target=\\\"_blank\\\">中</a> <a href=\\\"#\\\" target=\\\"_blank\\\">小</a>]\\\n        </div>\\\n        <div>\\\n            \\\n            \\\n            \\\n            <p>有时候我们希望<a href=\\\"http://www.blue1000.com/bkhtml/c157/\\\" target=\\\"_blank\\\" title=\\\"Windows 7教程\\\">Windows 7</a>在<a href=\\\"http://www.blue1000.com/bkhtml/c134/\\\" target=\\\"_blank\\\" title=\\\"局域网教程\\\">网络</a>连接状态发生变化（连接、断开）时自动执行一些指定的程序，比如网关验证程序、vpn、网络应用程序等。</p>\\\n<p><strong>步骤0.</strong>准备</p>\\\n<p><strong>思路理清</strong>：当网络发生变动时，会有某些事件被记录，那么我们执行的特定程序就在某些特定事件被记录之后。</p>\\\n<p><strong>相关程序</strong>：控制面板-管理工具-查看日志事件，控制面板-管理工具-计划任务</p>\\\n<p>[01]</p>\\\n<p></p><div><img src=\\\":/e9f2808e5faf4a9d8da677cdadcca46d\\\" type=\\\"image/jpeg\\\" data-filename=\\\"Image.jpg\\\" height=\\\"258\\\" width=\\\"576\\\"/></div><p></p>\\\n<p>[02]</p>\\\n<p></p><div><img src=\\\":/5f9dde77af5c4d859137a2198890ee8a\\\" type=\\\"image/jpeg\\\" data-filename=\\\"Image.jpg\\\" height=\\\"258\\\" width=\\\"576\\\"/></div><p></p>\\\n<p><strong>步骤1. </strong>连接网络，得到特定<strong>事件的ID</strong>。</p>\\\n<p>查看网卡的连接日志事件 中 左侧树展开：应用程序和服务日志-<span style=\\\"x-evernote:highlighted;background-color:#F6EE96;\\\">Microsoft-Windows-WLAN-AutoConfig-Operational</span> ，首先清空这里的日志，然后连接公司的网络。接下来就可以看到一系列的事件。</p>\\\n<p>[11]</p>\\\n<p></p><div><img src=\\\":/c6dc9fb8dcfc42cc8c25df5f0c43b54d\\\" type=\\\"image/jpeg\\\" data-filename=\\\"Image.jpg\\\" height=\\\"319\\\" width=\\\"576\\\"/></div><p></p>\\\n<p>从事件的详细信息中，确认对应网络的<strong>SSID</strong>。（加入不同的网络事件ID会不一样）</p>\\\n<p>[12]</p>\\\n<p></p><div><img src=\\\":/7a92919d03c44a7ba5bd02748288a22d\\\" type=\\\"image/jpeg\\\" data-filename=\\\"Image.jpg\\\" height=\\\"319\\\" width=\\\"576\\\"/></div><p></p>\\\n<p><strong>步骤2.</strong>将执行程序的操作附加到特定事件发生后</p>\\\n<p>[21]</p>\\\n<p></p><div><img src=\\\":/97cf663a858248328797ba61c492dc97\\\" type=\\\"image/jpeg\\\" data-filename=\\\"Image.jpg\\\" height=\\\"320\\\" width=\\\"576\\\"/></div><p></p>\\\n<p>设置完成后在计划任务中可以看到对应的事件</p>\\\n<p>[22]</p>\\\n<p></p><div><img src=\\\":/4018cd65863f4420936ea06809d2e90e\\\" type=\\\"image/jpeg\\\" data-filename=\\\"Image.jpg\\\" height=\\\"355\\\" width=\\\"576\\\"/></div><p></p>\\\n<p><strong>步骤3.</strong>当这个网络断开连接后，关闭上步执行的程序</p>\\\n<p>在网络连接正常的情况下清空 Microsoft-Windows-WLAN-AutoConfig-Operational 的日志，然后断开网络。从中查找对应的事件ID，然后重复步骤2.</p>\\\n<p><span style=\\\"x-evernote:highlighted;background-color:#F6EE96;\\\">PS：</span><a href=\\\"http://www.blue1000.com/bkhtml/c161/\\\" target=\\\"_blank\\\" title=\\\"Linux教程\\\"><span style=\\\"x-evernote:highlighted;background-color:#F6EE96;\\\">Linux</span></a><span style=\\\"x-evernote:highlighted;background-color:#F6EE96;\\\">、ubuntu 的直接把脚本放在 /etc/network/if-up.d/ 和/etc/network/if-dn.d/ 下即可</span></p>\\\n            <p><strong>关键词：</strong><a href=\\\"http://www.it55.com/search.aspx?where=nkey&amp;keyword=413\\\" target=\\\"_blank\\\">网络</a>  <a href=\\\"http://www.it55.com/search.aspx?where=nkey&amp;keyword=904\\\" target=\\\"_blank\\\">连接</a>  <a href=\\\"http://www.it55.com/search.aspx?where=nkey&amp;keyword=2331\\\" target=\\\"_blank\\\">执行</a>  <a href=\\\"http://www.it55.com/search.aspx?where=nkey&amp;keyword=4494\\\" target=\\\"_blank\\\">断开</a>  </p>\\\n        </div>\\\n\\t\\\n\\t\\\n\\t\\t</div></div></div><br/></div></span>\\\n</div></body></html>\\u0000\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":3647}]"
metadata_diff: {"new":{"id":"70934a4d89844baaadbbafc2762facd8","parent_id":"f67288c3a0be4374b5d532b5dcc3aabc","latitude":"0.00000000","longitude":"0.00000000","altitude":"0.0000","author":"","source_url":"","is_todo":0,"todo_due":0,"todo_completed":0,"source":"joplin-desktop","source_application":"net.cozic.joplin-desktop","application_data":"","order":1764348851632,"markup_language":2,"is_shared":0,"share_id":"","conflict_original_id":"","master_key_id":"","user_data":"","deleted_time":0},"deleted":[]}
encryption_cipher_text: 
encryption_applied: 0
updated_time: 2025-11-28T21:04:34.966Z
created_time: 2025-11-28T21:04:34.966Z
type_: 13