batch-file

How to call a batch file that is one level up from the current directory?

∥☆過路亽.° 提交于 2020-04-23 03:51:10
问题 I'm using a batch file in folder1/folder2/file.bat There is a batch file in parent folder folder1 , that I want to open through file.bat I have tried using: start ..\..\code.bat But this results in an error message, because file couldn't be found. Any ideas? 回答1: You could just: cd.. start Code.bat And that would start code.bat from its own directory 回答2: I want to explain better what should be used with an example as the answers posted up to now work only with current working directory being

Batch file to attach icons to subfolders

北城余情 提交于 2020-04-20 17:11:21
问题 DESCRIPTION 00) I have a folder with subfolders with subfolders. 01) Every parent and child have an .ico file. 02) All .ico files have exactly the same name. WHAT I AM TRYING TO DO I am trying to create a batch file that would attach each .ico to its folder MY STEPS In the beginning it sounded easy and I created a desktop.ini file with the following content : [.ShellClassInfo] ConfirmFileOp=0 NoSharing=1 IconFile=Icon.ico IconIndex=0 InfoTip= Then I created a script that does the job : REM cd

Batch file to attach icons to subfolders

早过忘川 提交于 2020-04-20 17:09:48
问题 DESCRIPTION 00) I have a folder with subfolders with subfolders. 01) Every parent and child have an .ico file. 02) All .ico files have exactly the same name. WHAT I AM TRYING TO DO I am trying to create a batch file that would attach each .ico to its folder MY STEPS In the beginning it sounded easy and I created a desktop.ini file with the following content : [.ShellClassInfo] ConfirmFileOp=0 NoSharing=1 IconFile=Icon.ico IconIndex=0 InfoTip= Then I created a script that does the job : REM cd

Why is this script failing to replace the hosts file?

▼魔方 西西 提交于 2020-04-18 05:46:06
问题 We want to make a change to hosts file of our mobile PC we are adding to our sites. However the client isn't so well versed with computers, that's why I wanted to create a batch file to do the update for them. The idea is to -Make a copy of the original with the date it was copied. -Update the hosts file. Due to dealing with win 10 and 7 we found out sometimes we cant straight update the hosts file without copying it first and then override the original. Therefore the procedure I thought

run multiple curl command from batch file sequentially

蹲街弑〆低调 提交于 2020-04-17 21:28:08
问题 I have a text file containing multiple URLs and I want to run using below code : curl -i URL.txt like this, I want to run multiple commands sequentially from a batch file. So is there a way to run this. 来源: https://stackoverflow.com/questions/61189635/run-multiple-curl-command-from-batch-file-sequentially

Fuzzy find using exported google contacts: remove newline inside double quotes

断了今生、忘了曾经 提交于 2020-04-17 20:37:10
问题 With a bit of time on my hands, I have a WINDOWS batch script to fuzzy find inside my exported Google Contacts. The selected export format is Google CSV - and no surprise it isn't easy work! After fixing the current directory my script processes a seed parameter for fzf.exe --query option. We then pipe the raw export: Using cut and tr to select some useful fields. Next is the fzf interface - brilliant! Then we make a list by adding newlines Finally we copy the output, then display a numbered

change registry value for currently logged in Windows user, when running script as SYSTEM user (batch)

匆匆过客 提交于 2020-04-17 20:24:28
问题 I have this code in a batch script. REG ADD HKEY_CURRENT_USER\MyKey /ve /t REG_DWORD /d 1 /f The problem is the script is run using the system account as a scheduled task in Windows. When using the system account to run the task it does not apply the value to the currently logged in Windows user's registry. I could not find a way to set the task to use the currently logged in user, so had to set it to use the system account. I attempted to use this solution; however it does not apply to the

change registry value for currently logged in Windows user, when running script as SYSTEM user (batch)

故事扮演 提交于 2020-04-17 20:15:06
问题 I have this code in a batch script. REG ADD HKEY_CURRENT_USER\MyKey /ve /t REG_DWORD /d 1 /f The problem is the script is run using the system account as a scheduled task in Windows. When using the system account to run the task it does not apply the value to the currently logged in Windows user's registry. I could not find a way to set the task to use the currently logged in user, so had to set it to use the system account. I attempted to use this solution; however it does not apply to the

Use 7-Zip to Compress folders within a directory and then delete the source folder used to create the .zip file

亡梦爱人 提交于 2020-04-16 08:31:05
问题 I need to run a script to compress all folders within a folder that is 2 levels within a directory structure. I want the script to compress all folders within the log folder and then delete the original folder, thus saving loads on space. To illustrate the folders I wish to compress, see below: Drive Location-->machinename-->logtype-->folders_i_want_to_compress Within folder 2 there are folders with dates in the format yyyymmdd and it is these that I wish to compress as zip files. I cannot