scripting

Batch Script To Extract Lines Between Specified Words

本小妞迷上赌 提交于 2020-06-17 04:56:46
问题 I have a log file like below. [Tue Aug 19 10:45:28 2014]Local/PLPLAN/PL/giuraja@MSAD/2172/Info(1019025) Reading Rules From Rule Object For Database [PL] [Tue Aug 19 10:45:28 2014]Local/PLPLAN/PL/giuraja@MSAD/2172/Info(1013157) Received Command [Import] from user [giuraja@MSAD] using [AIF0142.rul] with data file [SQL] . . . . . Clear Active on User [giuraja@MSAD] Instance [1] . . I want to extract the line starting with "[Tue Aug 19 10:" until the line that starts with "Clear Active on User"

Converting msiexec command from cmd to powershell

一世执手 提交于 2020-06-17 02:19:46
问题 In my powershell script, I need to run couple of msiexec commands quietly. The problem is when I try to run the command, the Windows Installer help popup shows rather than executing the command. (Below Image) The same command runs well in cmd. Below is my command. I have kept the & in the command in double quotes to consider it as a string as suggested. & msiexec /log c:\msxml.log /quiet /I "&" D:\LoadGeneratorsetup\prerequisites\msxml6\msxml6_x64.msi I tried using Start-Process -FilePath to

Converting msiexec command from cmd to powershell

只愿长相守 提交于 2020-06-17 02:18:01
问题 In my powershell script, I need to run couple of msiexec commands quietly. The problem is when I try to run the command, the Windows Installer help popup shows rather than executing the command. (Below Image) The same command runs well in cmd. Below is my command. I have kept the & in the command in double quotes to consider it as a string as suggested. & msiexec /log c:\msxml.log /quiet /I "&" D:\LoadGeneratorsetup\prerequisites\msxml6\msxml6_x64.msi I tried using Start-Process -FilePath to

Deno: How to substitute npm scripts (package.json)

本小妞迷上赌 提交于 2020-06-15 05:13:27
问题 Since it is not necessary to have package.json file with deno, how can I as a developer have a similar experience just as we have with npm scripts in package.json ? 回答1: deno install You can create executable, aliased scripts with deno install. It will provide a thin shell/cmd wrapper for the specified main module and CLI arguments. Example: deno install --root . -n serve --allow-read --allow-net https://deno.land/std@0.54.0/http/file_server.ts The result is a serve script, similar to npm

Deno: How to substitute npm scripts (package.json)

耗尽温柔 提交于 2020-06-15 05:12:08
问题 Since it is not necessary to have package.json file with deno, how can I as a developer have a similar experience just as we have with npm scripts in package.json ? 回答1: deno install You can create executable, aliased scripts with deno install. It will provide a thin shell/cmd wrapper for the specified main module and CLI arguments. Example: deno install --root . -n serve --allow-read --allow-net https://deno.land/std@0.54.0/http/file_server.ts The result is a serve script, similar to npm

How to disable “ActiveX Control May Be Unsafe” popup

落爺英雄遲暮 提交于 2020-06-09 11:26:07
问题 In an HTML file on My Computer, I'm trying to use the Scripting.FileSystemObject in a script. How can I disable the popup saying "Any ActiveX control on this page may be unsafe for scripting"? The "Internet Options" Security pane allows one to set "Initialize and script ActiveX controls not marked as safe for scripting" to Enabled for various zones, but files on the local computer don't appear to be in any of the listed zones. So I guess the alternate question is "How can I edit the security

Lua script for Redis which sums the values of keys

為{幸葍}努か 提交于 2020-06-09 11:19:54
问题 I am building out my first Redis server side script ( for debugging ) and my lack of Lua experience has me quite stuck. Essentially have a dataset of K/V pairs (containing ~1000 values) from which I want to list all the KEYS that match a pattern. For example in redis-cli: > KEYS "carlos:*" 1) "carlos:1" 2) "carlos:2" 3) "carlos:3" 4) "carlos:4" Based on the above output I want to return the sum of those keys by executing a Lua script. Currently I have the following on my sum.lua local sum = 0

Lua script for Redis which sums the values of keys

荒凉一梦 提交于 2020-06-09 11:19:48
问题 I am building out my first Redis server side script ( for debugging ) and my lack of Lua experience has me quite stuck. Essentially have a dataset of K/V pairs (containing ~1000 values) from which I want to list all the KEYS that match a pattern. For example in redis-cli: > KEYS "carlos:*" 1) "carlos:1" 2) "carlos:2" 3) "carlos:3" 4) "carlos:4" Based on the above output I want to return the sum of those keys by executing a Lua script. Currently I have the following on my sum.lua local sum = 0

Lua script for Redis which sums the values of keys

心不动则不痛 提交于 2020-06-09 11:17:31
问题 I am building out my first Redis server side script ( for debugging ) and my lack of Lua experience has me quite stuck. Essentially have a dataset of K/V pairs (containing ~1000 values) from which I want to list all the KEYS that match a pattern. For example in redis-cli: > KEYS "carlos:*" 1) "carlos:1" 2) "carlos:2" 3) "carlos:3" 4) "carlos:4" Based on the above output I want to return the sum of those keys by executing a Lua script. Currently I have the following on my sum.lua local sum = 0

Copy files to network computers on windows command line

佐手、 提交于 2020-05-24 18:14:31
问题 I am trying to create a script on Windows which when run on an admin PC: Copies a folder from the admin PC into a group of network PCs by specifying the ip address / range For each destination PC, Navigate into the folder and run another script file. Using the method described by seanyboy here: net use \\{dest-machine}\{destfolder} {password} /user:{username} copy {file} \\{dest-machine}\{destfolder} I'm not sure on how i can write a 'for' loop to go through each 'dest-machine' and perform