batch-file

Batch File to list folders and allow user selection

…衆ロ難τιáo~ 提交于 2021-02-08 08:21:35
问题 I have searched and searched to find a solution to (what feels like) a unique problem. Many answers here have been quite helpful and have gotten me a long way, but the last bit has me stumped. My batch file needs to open an executable in a folder with a variable name This folder may be in one of two directories This is what I originally had and it works @ECHO OFF SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION SET DIR1="%USERPROFILE%\AppData\Local\Application Workspace\Profiles" SET DIR2=C:

How do I make a folder with today's date and then copy a file to it?

元气小坏坏 提交于 2021-02-08 07:37:21
问题 I am trying to automate my day, part of which is creating a daily work folder and copying a 'Job Notes' file which I use, rename and save per job, repeat again the next day. I found a script to create a folder based on today's date, which works, and I've obviously found examples of how to copy a file. What I'm looking for is to combine the two. I just need something basic. Here is the code I have for the folder creation. I just don't know what to add to the "copy file" action to make it use

How do I make a folder with today's date and then copy a file to it?

走远了吗. 提交于 2021-02-08 07:37:08
问题 I am trying to automate my day, part of which is creating a daily work folder and copying a 'Job Notes' file which I use, rename and save per job, repeat again the next day. I found a script to create a folder based on today's date, which works, and I've obviously found examples of how to copy a file. What I'm looking for is to combine the two. I just need something basic. Here is the code I have for the folder creation. I just don't know what to add to the "copy file" action to make it use

Send string parameters to a Start-Job script block

别来无恙 提交于 2021-02-08 06:53:25
问题 I need to initialize a job using the shell. The job will be a delay plus a call to a vbScript. The following code works fine. For my example, the vbScript is just a single line with a MsgBox "Hello world!" $functions = { Function execute_vbs { param ([string]$path_VBScript, [int]$secs) Start-Sleep -Seconds $secs cscript /nologo $path_VBScript } } $seconds = 2 Start-Job -InitializationScript $functions -ScriptBlock {execute_vbs -path_VBScript 'C:\Users\[USERNAME]\Desktop\hello_world.vbs' -secs

Split values into separate lines for each delimiter - batch

折月煮酒 提交于 2021-02-08 06:15:06
问题 I'm trying to split the values of a csv file into separate lines using the delimiter=, as a point to split from. i.e. #csv file video1,video2,video3 video4,video5,video6 #Preferred output: video1, video2, video3, ect.... So far I have: @echo off setLocal EnableDelayedExpansion for /f "tokens=* delims=, " %%a in (input.csv) do ( set /a N+=1 echo ^%%a^,>>output.csv ) However I run into the issue of parameter %%a just being added as a string. How would I cause a split instead for each , and put

Split values into separate lines for each delimiter - batch

*爱你&永不变心* 提交于 2021-02-08 06:14:27
问题 I'm trying to split the values of a csv file into separate lines using the delimiter=, as a point to split from. i.e. #csv file video1,video2,video3 video4,video5,video6 #Preferred output: video1, video2, video3, ect.... So far I have: @echo off setLocal EnableDelayedExpansion for /f "tokens=* delims=, " %%a in (input.csv) do ( set /a N+=1 echo ^%%a^,>>output.csv ) However I run into the issue of parameter %%a just being added as a string. How would I cause a split instead for each , and put

Remove lines from a file starting with a space, including empty lines

巧了我就是萌 提交于 2021-02-08 05:46:16
问题 To delete all lines of a txt file that begins with a space (including empty lines), I write findstr /v /b /c:" " <%1>result.out. Indeed, result.out file get answer for me if there is no longer both space at beginning of every line and empty line. What I have done still leaving lines header empty, it also preserves blank lines what i want to give up. Finally, the result.out output must have consecutive lines always containing a text at begining of each line. Please someone could tell me what

detect whether web browser is open or close using batch file

孤街浪徒 提交于 2021-02-08 05:43:45
问题 I would like to access my web browser using a batch file.Is there a way of knowing whether any web browser is open or not using a batch file? Take any browser for example. 回答1: Yes, there is a way. The command tasklist returns you a list of running tasks: @ECHO OFF SET running=0 FOR /f "tokens=*" %%A IN ('tasklist^ /v^| findstr /i /c:"firefox32.exe"') DO SET running=1 IF %running%==1 ECHO Firefox is running! PAUSE This checks whether Firefox is running. 来源: https://stackoverflow.com/questions

Compile Inno Setup project through a batch file (.bat)

纵饮孤独 提交于 2021-02-08 05:13:56
问题 In my work project, we have to create 4 installers using Inno Setup. That way, I have to run file by file, which ends up demanding more of my time. Files *.iss: setup_prog_01.iss; setup_prog_02.iss; setup_prog_03.iss; setup_prog_04.iss; Would it be possible to create a batch file (.bat) to compile all these *.iss files at once? 回答1: There's ISCC.exe command-line Inno Setup compiler. So you can do: ISCC.exe setup_prog_01.iss ISCC.exe setup_prog_02.iss ISCC.exe setup_prog_03.iss ISCC.exe setup

Compile Inno Setup project through a batch file (.bat)

╄→гoц情女王★ 提交于 2021-02-08 05:11:40
问题 In my work project, we have to create 4 installers using Inno Setup. That way, I have to run file by file, which ends up demanding more of my time. Files *.iss: setup_prog_01.iss; setup_prog_02.iss; setup_prog_03.iss; setup_prog_04.iss; Would it be possible to create a batch file (.bat) to compile all these *.iss files at once? 回答1: There's ISCC.exe command-line Inno Setup compiler. So you can do: ISCC.exe setup_prog_01.iss ISCC.exe setup_prog_02.iss ISCC.exe setup_prog_03.iss ISCC.exe setup