batch-file

Creating a perl script to batch process files

会有一股神秘感。 提交于 2020-01-06 03:40:22
问题 I have this line of code: convert 1234_Page_1_....png 1234_Page_2_....png output.pdf This merges those particular pngs to a single pdf (using ImageMagick). I have a bunch of files in this format. I would like to perform this merging/converting-to-pdf action on files that have the same number before the " Page ". Sometimes there are more than two pages to convert. I would like to have this done in a perl script that I can run on Windows. Thanks in advance, Jake 回答1: If you wanted to call

How to delete log file after a week?

牧云@^-^@ 提交于 2020-01-06 02:51:25
问题 I have scheduled a batch job to run every 4 hour to fetch latest records from database. Also I'm maintaining log file which will be updated whenever batch job runs. In order to compensate storage memory I need to delete log file every week. I had tried to solve the task with Batch file to delete files older than N days. In my case file log files will be updated every 4 hours. 回答1: It is not advisable to delete the entire log file on which lines are appended regularly as this results in losing

Creating a batch file that opens google chrome and puts input into the search box?

元气小坏坏 提交于 2020-01-06 02:51:05
问题 So I am just playing with batch files and was curious if it was possible to create a batch file that opens the google browser and without typing into the search box, a variable from my batch file gets put into the search box. Anyone know if that's possible? Thanks. @echo off cd c:\program files (x86)\google\application start chrome.exe www.youtube.com I can open the web browser, I can even change the code to store the variable, but need to know how to send that variable to the search engine.

GUI Using Batch

亡梦爱人 提交于 2020-01-06 02:03:11
问题 When you try to do things using Windows Batch, you normally think on a Text Program, but I want to know if there is anyway to use instead of those string inputs at the command window, put on a TextField , and that the messages get displayed at a MsgBox . Also, if it's possible to hide the console window. Don't matter if VBScript is needed, but only Batch should be better for me 回答1: There was GUI programs in DOS, remember that all windows version before 98 SE all started from DOS ( Not NT

Have a batch create text files based on a list

大憨熊 提交于 2020-01-06 01:16:52
问题 I've got to create a text file for each PC at my workplace is there a way to have a batch read from a list of PCs in a text file and create a text file for each line of text? Ex. Text File Computer1 Computer2 Computer3 I want it to create a computer1.txt, computer2.txt, and computer3.txt, but for a list of about 400 PCs... It seems pretty easy I'm just not sure how to link batch files together. I'm learning! :) Thanks for all your help, as always! 回答1: @echo off setlocal for /f "tokens=*" %%a

How to check service startup type from batch script? (in windows 7)

岁酱吖の 提交于 2020-01-06 01:16:20
问题 I need to start a service from batch file (using sc start XXX ), but ONLY if it is configured with an automatic start up type. I read the instructions of sc /? and I tried calling first to sc qc XXX command in order to query for it's configuration and then use findstr on the result, but I got the following error after sc qc XXX command: [SC] QueryServiceConfig FAILED 122: The data area passed to a system call is too small. [SC] GetServiceConfig needs 718 bytes The specified service does not

Find out if a process finished running

空扰寡人 提交于 2020-01-05 23:41:33
问题 I have a server which receives commands from a client and runs them. These commands use one specific batch script, which receives arguments and runs. The script calls an external console application program with these arguments. The arguments can also instruct the script to run multiple instances of the console application, in the background. So, the outcome could be one open CMD , running 3 instances of app.exe , in the background. I wish to know when each one of those processes of app.exe

batch script to extract lines between two specified lines

别说谁变了你拦得住时间么 提交于 2020-01-05 19:44:50
问题 I have a text file and would like to extract all the lines between two specified lines using windows batch scripting. Line1: !FILE_FORMAT=ADS Line2: !VERSION=1.0 . . LineX: 'Parent|Child|IsPrimary| * *** (the line starts with ' and is long) . . LineY: !PropertyArray=Cost Center (The lines starts with !) . . LineZ. I want to extract all the lines between LineX and LineY and output it to another file. The below code finds the starting line correctly. But it just deletes the line(Line Y) where I

echo. is not working?

≯℡__Kan透↙ 提交于 2020-01-05 14:25:14
问题 I'm creating A Small Program To Help With The Infamous Windows Update Fail in Windows 7! What I'm Using Is A Batch But For Some Reason The "echo." isn't showing blank lines. Any Ideas. Here's my code below @echo off :checkPrivileges NET FILE 1>NUL 2>NUL if '%errorlevel%' == '0' ( goto gotPrivileges ) else ( goto getPrivileges ) :getPrivileges if '%1'=='ELEV' (shift & goto gotPrivileges) ECHO. ECHO ************************************** ECHO Invoking Administration Privledges ECHO ************

%errorlevel% doesn't work in Windows XP. But it works in Windows7

若如初见. 提交于 2020-01-05 14:05:22
问题 %errorlevel% doesn't work in WindowsXP. As I know when an error occurs %errorlevel% set 1 or above value, and if there is no error it will set 0. But, even though there is no error, %errorlevel% is 1. And I set %errorlevel% 0, even there is an error %errorlevel% is sill 0. I think OS doesn't change %errorlevel% in XP. In Win7 it work totally. @echo off setlocal enabledelayedexpansion call dir echo errorlevel=%errorlevel% REM expected errorlevel=0 but 1 call dor echo errorlevel=%errorlevel%