batch-file

how to scan a windows registry's all user profiles and fetch the value of ProxyEnable and proxy server using REG query

生来就可爱ヽ(ⅴ<●) 提交于 2020-06-17 14:54:16
问题 Please tell me how to search each profile of HKEY_USERS and find the value of ProxyEnable and proxy server. I have a Nodejs binary(.exe) which basically runs in individual machines. I use Procrun(commons.apache.org/proper/commons-daemon/procrun.html) to run my Nodejs application as a service. and the Nodejs application tries to find the proxy config through child process which runs this reg query. Due to some other limitation of application its always fetching the details from the default

Installing .msi remotely without powershell?

本小妞迷上赌 提交于 2020-06-17 06:33:26
问题 We have a multi server system that we need to install at a client site. I would like to put together a script that can: Turn off services on remote machines Uninstall software on several remote machines Install .msi files several remote machines I've struggled with psexec and wmic to do points #2 and #3. It seems like there has to be an easier way without having to resort to PowerShell . 回答1: First, see this thread for WSH Remoting : Remote Install on Windows Server 2012 R2. Then, you can

Installing .msi remotely without powershell?

烂漫一生 提交于 2020-06-17 06:33:13
问题 We have a multi server system that we need to install at a client site. I would like to put together a script that can: Turn off services on remote machines Uninstall software on several remote machines Install .msi files several remote machines I've struggled with psexec and wmic to do points #2 and #3. It seems like there has to be an easier way without having to resort to PowerShell . 回答1: First, see this thread for WSH Remoting : Remote Install on Windows Server 2012 R2. Then, you can

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"

Test IF file exist, ELSE xcopy these two files

天涯浪子 提交于 2020-06-14 06:18:30
问题 Morning all. So I've been up hours trying to cobble together -a variety of replies to other posts- into my own code in order to see if I could get something usable. No-go. I'm sufficiently lost in the sauce that I've now got to ask for some help from you. Background: OS: Windows 10 I use the program text2folders.exe to create 20-30 new folders on a secondary drive every night. Primarily, I have a base file "aGallery-dl.bat" that I populate each folder with using an xcopy batch file.

Test IF file exist, ELSE xcopy these two files

纵饮孤独 提交于 2020-06-14 06:18:06
问题 Morning all. So I've been up hours trying to cobble together -a variety of replies to other posts- into my own code in order to see if I could get something usable. No-go. I'm sufficiently lost in the sauce that I've now got to ask for some help from you. Background: OS: Windows 10 I use the program text2folders.exe to create 20-30 new folders on a secondary drive every night. Primarily, I have a base file "aGallery-dl.bat" that I populate each folder with using an xcopy batch file.

Windows batch split long string by length 64

二次信任 提交于 2020-06-13 09:24:09
问题 I have tried to figure this out without any luck. Can anyone help on this? I have a file: input.txt This file contains a long string - and i want to split the long string into 64 long string chunks, and save the content to a different file. I don't have much so far, i know i have to use the for loop: echo off set /p base64=<input.txt for /f "%base64:~0,64%" %%G IN %base64% DO echo %%G But how to make the loop for each 64 characters in line - and in a batch script? Any help will be appreciated

How can I create a vbs file by batch without losing those lines?

寵の児 提交于 2020-06-13 07:00:10
问题 Everytime I tries to create a vbs file by batch , some lines are missing in the vbs file @echo off echo Function RunAsAdmin() >> 2.vbs echo If WScript.Arguments.length = 0 Then >> 2.vbs echo CreateObject("Shell.Application").ShellExecute "wscript.exe", """" & _ >> 2.vbs echo WScript.ScriptFullName & """" & "RunAsAdministrator""",,"runas", 1 >> 2.vbs echo WScript.Quit >> 2.vbs echo End If >> test.vbs What do i need to keep these 2 lines when making a vbs file by batch? echo CreateObject("Shell

Issues when getting a list of user profiles using WMIC

末鹿安然 提交于 2020-06-13 00:46:09
问题 I was using the following batch command to retrieve all local user profiles (including domain users too) : for /f "delims=" %%I in ('dir /a:d-h /b "%SystemDrive%\Users\*" 2^>nul ^| %SystemRoot%\System32\findstr.exe /i /l /x /v /g:"%bin%\exclude_users.txt"') do ( The problem is that this command has its limits: it doesn't really check if the users in question do actually have an account. The user Compo provided me a methodology for retrieving the profile names, using WMIC. So I ended up