{"id":181,"date":"2015-06-15T11:51:06","date_gmt":"2015-06-15T08:51:06","guid":{"rendered":"https:\/\/4.fratz.ru\/?p=181"},"modified":"2023-12-04T14:41:21","modified_gmt":"2023-12-04T11:41:21","slug":"cmdvbs","status":"publish","type":"post","link":"https:\/\/4.fratz.ru\/?p=181","title":{"rendered":"CMD\/VBS"},"content":{"rendered":"<p>\u0414\u043e\u043b\u0433\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u043b\u0441\u044f, \u0438 \u043d\u0430\u043a\u043e\u043d\u0435\u0446 \u043d\u0430\u0447\u0430\u043b \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u043a\u0443 \u043f\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c \u0432 CMD \u0438 VBS (\u043c\u0430\u043b\u043e-\u043b\u0438 \u043a\u043e\u043c\u0443 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f \u0434\u043b\u044f \u0434\u043e\u043c\u0435\u043d\u043d\u044b\u0445 \u0441\u0431\u043e\u0440\u043e\u043a \u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e). \u0411\u0443\u0434\u0443 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u043e \u043c\u0435\u0440\u0435 \u0432\u0441\u043f\u043b\u044b\u0432\u0430\u043d\u0438\u044f \u0432\u044b\u0448\u0435\u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b\u0445, \u0432\u0441\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0440\u0430\u0431\u043e\u0447\u0438\u0435 \u0438 \u043f\u043e\u0434 Win2003R2 \u043e\u0442\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f:<!--more--><\/p>\n<p>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u043f\u0440\u0438\u043d\u0442\u0435\u0440\u043e\u0432 \u0438 \u0434\u0438\u0441\u043a\u043e\u0432 \u0432 AD (Active Directory):<br \/>\n<span style=\"color: #008000;\">@echo off<\/span><br \/>\n<span style=\"color: #008000;\">net use Z: \\\\NAS\\Public \/persistent:yes<\/span><br \/>\n(\u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0441\u0442\u0438 \u0441\u0435\u0442\u0435\u0432\u043e\u0433\u043e \u0434\u0438\u0441\u043a\u0430 <span style=\"color: #008000;\"><strong>persistent:no\/yes<\/strong><\/span>)<br \/>\n<span style=\"color: #008000;\">start \\\\serv\\hp3035<\/span> - \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u044b\u0445 \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u043f\u0440\u0438\u043d\u0442\u0435\u0440\u043e\u0432<br \/>\n<span style=\"color: #008000;\">start \\\\serv\\hp3015<\/span><br \/>\n<span style=\"color: #008000;\">start \\\\serv\\Brother<\/span>&nbsp;(\u0442\u043e\u0447\u043d\u044b\u0439 \u0430\u0434\u0440\u0435\u0441 \u0438 \u0438\u043c\u044f, \u043b\u0443\u0447\u0448\u0435 \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u0441\u0435\u0442\u0435\u0432\u043e\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435)<br \/>\n<span style=\"color: #008000;\">rundll32 printui.dll,PrintUIEntry \/y \/n \"\\\\serv\\hp3035\"<\/span> - \u043f\u0440\u0438\u043d\u0442\u0435\u0440 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e<\/p>\n<p><span style=\"color: #008000;\">cscript prnmngr.vbs -d -p \"\\\\SERVER\\PRINTER\"<\/span> - \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u0438\u043d\u0442\u0435\u0440 \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435<br \/>\n<span style=\"color: #008000;\">net use L: \/delete \/yes<\/span> -\u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0441\u0435\u0442\u0435\u0432\u043e\u0433\u043e \u0434\u0438\u0441\u043a\u0430 \u0447\u0435\u0440\u0435\u0437&nbsp;CMD\/BAT<\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u043d\u0442\u0435\u0440\u043e\u0432 \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u0440\u0435\u0435\u0441\u0442\u0440\u0430 \u0447\u0435\u0440\u0435\u0437&nbsp;CMD\/BAT:<br \/>\n<span style=\"color: #008000;\">REG ADD&nbsp;(or DELETE)<\/span><br \/>\n<span id=\"delcmd\" style=\"color: #008000;\">\"HKEY_CURRENT_USER\\Printers\\Connections\\,,serv,HP LaserJet M3035 MFP PCL 6\" \/f<\/span><\/p>\n<hr \/>\n<p><u>\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u043e\u0432&nbsp;\u043f\u043e \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044e, \u0434\u0430\u0442\u0435,&nbsp;\u043c\u0430\u0441\u043a\u0435:<\/u><\/p>\n<p><span style=\"color: #008000;\">forfiles \/p \"C:\\Logs\" \/s \/d -365 \/m *.log \/c \"cmd \/c del @file\"<\/span><\/p>\n<p>(\u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0432 \u043f\u0430\u043f\u043a\u0435 <span style=\"color: #008000;\">C:\\Logs<\/span>&nbsp;\u0438 \u0435\u0435 \u043f\u043e\u0434\u043f\u0430\u043f\u043a\u0430\u0445 \u0441\u0442\u0430\u0440\u0448\u0435 \u0433\u043e\u0434\u0430 \u0444\u0430\u0439\u043b\u044b \u0441 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u043c &nbsp;<span style=\"color: #008000;\">.log<\/span>)<\/p>\n<p><span style=\"color: #008000;\">\/p<\/span> \u043f\u0443\u0442\u044c \u0432 \u043a\u0430\u0432\u044b\u0447\u043a\u0430\u0445<\/p>\n<p><span style=\"color: #008000;\">\/s<\/span> \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432 \u043f\u0430\u043f\u043a\u0435 \u0438 \u043f\u043e\u0434\u043f\u0430\u043f\u043a\u0430\u0445<\/p>\n<p><span style=\"color: #008000;\">\/d -365<\/span> &nbsp;\u0441\u0442\u0430\u0440\u0448\u0435 \u0433\u043e\u0434\u0430 \u043e\u0442 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0434\u0430\u0442\u044b<\/p>\n<p><span style=\"color: #008000;\">\/m *.log<\/span> \u043c\u0430\u0441\u043a\u0430 \u0444\u0430\u0439\u043b\u0430<\/p>\n<p><span style=\"color: #008000;\">forfiles \/?<\/span> (\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u0439 \u0445\u0435\u043b\u043f \u0432 cmd)<\/p>\n<hr \/>\n<p>VBS \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u043f\u0438\u0441\u044c\u043c\u0430 \u0441 \u0432\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0433\u043e \u043f\u043e\u0447\u0442\u043e\u0432\u0438\u043a\u0430<br \/>\n<span style=\"color: #008000;\">Path = \"C:\\CON\\Receive\\\"<\/span>%\u043f\u0430\u043f\u043a\u0430 \u0433\u0434\u0435 \u0438\u0449\u0435\u043c \u0444\u0430\u0439\u043b \u043f\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044e<br \/>\n<span style=\"color: #008000;\">Set Items = CreateObject(\"Shell.Application\").NameSpace(Path).Items<\/span><br \/>\n<span style=\"color: #008000;\"> Items.Filter 192, \"*.txt\"<\/span>%\u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435<br \/>\n<span style=\"color: #008000;\">If Items.Count = 1 Then<\/span><br \/>\n<span style=\"color: #008000;\"> Web = \"http:\/\/schemas.microsoft.com\/cdo\/configuration\/\"<\/span><br \/>\n<span style=\"color: #008000;\"> With CreateObject(\"CDO.Message\")<\/span><br \/>\n<span style=\"color: #008000;\">.From = \"e-mail\"<\/span>%\u041e\u0442 \u043a\u043e\u0433\u043e<br \/>\n<span style=\"color: #008000;\">.To = \"e-mail\"<\/span>%\u041a\u043e\u043c\u0443<br \/>\n<span style=\"color: #008000;\">.Subject = \"Hvost\"<\/span>%\u0422\u0435\u043c\u0430<br \/>\n<span style=\"color: #008000;\">.Textbody = \"Automatic mail-sender OOO Roga i Kopyta\"<\/span>%\u0422\u0435\u043b\u043e \u043f\u0438\u0441\u044c\u043c\u0430<br \/>\n<span style=\"color: #008000;\">.AddAttachment Path &amp; Items.Item(0)<\/span>%\u041f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u044f\u0435\u043c \u0438\u0441\u043a\u043e\u043c\u044b\u0439 \u0444\u0430\u0439\u043b<br \/>\n<span style=\"color: #008000;\">.AddAttachment \"C:\\CON\\Receive\\REC.json\"<\/span>%\u041f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u044f\u0435\u043c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u0444\u0430\u0439\u043b<br \/>\n<span style=\"color: #008000;\">.Configuration.Fields.Item (Web &amp; \"sendusing\") = 2<\/span>%\u0422\u0438\u043f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438<br \/>\n<span style=\"color: #008000;\">.Configuration.Fields.Item (Web &amp; \"smtpserver\") = \"192.168.1.2\"<\/span>%IP \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0433\u043e \u043f\u043e\u0447\u0442\u043e\u0432\u0438\u043a\u0430<br \/>\n<span style=\"color: #008000;\">.Configuration.Fields.Item (Web &amp; \"smtpserverport\") = 25<\/span><br \/>\n<span style=\"color: #008000;\"> .Configuration.Fields.Update<\/span><br \/>\n<span style=\"color: #008000;\"> .Send<\/span><br \/>\n<span style=\"color: #008000;\"> End With<\/span><br \/>\n<span style=\"color: #008000;\"> End If<\/span><\/p>\n<hr \/>\n<p>BAT-\u043f\u0443\u0441\u043a\u0430\u0447 \u0434\u043b\u044f&nbsp;<span style=\"color: #008000;\">TeamViewer<\/span>\u0430&nbsp;Portable (\u0434\u043b\u044f Win7x64):<\/p>\n<p><span style=\"color: #008000;\">@echo off<\/span><br \/>\n<span style=\"color: #008000;\">Reg delete \"HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\TeamViewer\" \/f<\/span><br \/>\n<span style=\"color: #008000;\">rd \/S \/Q \"%USERPROFILE%\\AppData\\Roaming\\TeamViewer\"<\/span><br \/>\n<span style=\"color: #008000;\">start D:\\TeamViewerPortable11\\TeamViewer.exe<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0414\u043e\u043b\u0433\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u043b\u0441\u044f, \u0438 \u043d\u0430\u043a\u043e\u043d\u0435\u0446 \u043d\u0430\u0447\u0430\u043b \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u043a\u0443 \u043f\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c \u0432 CMD \u0438 VBS (\u043c\u0430\u043b\u043e-\u043b\u0438 \u043a\u043e\u043c\u0443 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f \u0434\u043b\u044f \u0434\u043e\u043c\u0435\u043d\u043d\u044b\u0445 \u0441\u0431\u043e\u0440\u043e\u043a \u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e). \u0411\u0443\u0434\u0443 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u043e \u043c\u0435\u0440\u0435 \u0432\u0441\u043f\u043b\u044b\u0432\u0430\u043d\u0438\u044f \u0432\u044b\u0448\u0435\u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b\u0445, \u0432\u0441\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0440\u0430\u0431\u043e\u0447\u0438\u0435 \u0438 \u043f\u043e\u0434 Win2003R2 \u043e\u0442\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f:<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[15],"tags":[13],"_links":{"self":[{"href":"https:\/\/4.fratz.ru\/index.php?rest_route=\/wp\/v2\/posts\/181"}],"collection":[{"href":"https:\/\/4.fratz.ru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/4.fratz.ru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/4.fratz.ru\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/4.fratz.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=181"}],"version-history":[{"count":14,"href":"https:\/\/4.fratz.ru\/index.php?rest_route=\/wp\/v2\/posts\/181\/revisions"}],"predecessor-version":[{"id":690,"href":"https:\/\/4.fratz.ru\/index.php?rest_route=\/wp\/v2\/posts\/181\/revisions\/690"}],"wp:attachment":[{"href":"https:\/\/4.fratz.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=181"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/4.fratz.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=181"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/4.fratz.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=181"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}