batch-file

Escape ampersands in variables - win batch

喜欢而已 提交于 2020-01-22 17:10:06
问题 I have a variable that contains ampersands and I need to create another variable that contains the first one. I know the "&" character can be escaped with carret (^) but I have no idea how to escape the text inside a variable. set Name1 = Red ^& Green set Name2 = %Name1% ^& Blue 'Green' is not recognized as an internal or external command, operable program or batch file. I can't even "echo" the variables containing ampersands - I get the same error. I need to use the variables in order to

Using DDD, How Does One Implement Batch Processing?

妖精的绣舞 提交于 2020-01-22 15:22:12
问题 I have logic consisting of selecting a large number of records from one system, performing multiple transformations (based on business rules) and inserting them into another system. It seems like a high performance (and memory) hit to instantiate each of these records as an object, perform transformations on them and then insert all of these object into the other system. Is the best way to achieve this in DDD to skip the classes/objects and do it straight through SQL, maybe a stored procedure

Batch convert files with pandoc in windows

孤街醉人 提交于 2020-01-22 12:57:27
问题 I looked around and the only answer I found was pandoc (if anybody knows any programs with a ui that can do this in batches that would be great). If not what I'd like to do is have two bat files in a directory, one to be able to convert all the files in a directory and any subdirectories from markdown to HTML, the other to convert back. I just don't get how to get the "for in" recursive thing working in the command prompt (noob here). I got how to convert single files to and from with the

Windows batch, select ONLY user variables

泄露秘密 提交于 2020-01-22 12:47:07
问题 In environment variables I have a PATH variable for both user variables and system variables. In a batch script, in order for me to append the user PATH variable with a new given path, I need to select the current value. Unfortunately %PATH% returns a combination of the user variable and the system variable. Of course I only want to add a new custom path value to the user variable. There is no point in enhancing it with the system path as well. That's why I have 2 variables. Thanks in advance

enable Win10 inbuild hotspot by cmd/batch/powershell

怎甘沉沦 提交于 2020-01-22 12:43:11
问题 as the title says I search for a way to enable/disable the Hotspot inbuild in Win10 via the command prompt/powershell/a batch file. In the GUI it can be easily done with the third button in the network panel (see image below), but I want to automate it. I already found some hundred tutorials how to create a new hotspot via netsh, but as I understand it this would create another, different hotspot. Instead I want to use the already configured one. Or does Win10 the same and everytime creates a

enable Win10 inbuild hotspot by cmd/batch/powershell

你。 提交于 2020-01-22 12:42:45
问题 as the title says I search for a way to enable/disable the Hotspot inbuild in Win10 via the command prompt/powershell/a batch file. In the GUI it can be easily done with the third button in the network panel (see image below), but I want to automate it. I already found some hundred tutorials how to create a new hotspot via netsh, but as I understand it this would create another, different hotspot. Instead I want to use the already configured one. Or does Win10 the same and everytime creates a

Windows batch copy files from subfolders to one folder

ぃ、小莉子 提交于 2020-01-22 09:01:26
问题 I had tried to make batch script that copies all *.tif files located in D:\images(random named subfolders here) to d:\all. xcopy D:\Downloads\*.TIF D:\temp\ /s works, but it copies with all folder tree. I tried to use other keys, but its dont works. Thanks for help! 回答1: FOR is your friend. Read HELP FOR on the /R option and the %~nx variable substitution; and then try this very simple code. pushd d:\downloads for /r %%a in (*.tif) do ( echo COPY "%%a" "d:\temp\%%~nxa" ) popd watch carefully

Convert all CR to CRLF in text file using CMD

瘦欲@ 提交于 2020-01-22 07:32:13
问题 Is there a way to convert all CRs to CRLFs in a text file? When I open a text file from Linux server on Windows, all text is displayed in one line, but actually it's a multi line one. I'd like to perform the conversion in a batch file. Can anyone advice, please? 回答1: Line separators and line terminators have been a source of compatibility friction between systems as long as there has been more than one kind of system and an urge to exchange data. The Wikipedia article on the Newline has a

Setting playback device by executing a batch file / powershell script

允我心安 提交于 2020-01-22 04:42:17
问题 I've got my computer(Windows 7) hooked up to the TV, and i very often change output device for sound between Digital Audio (S/PDIF)(High definition audio device) and my headset (2- Corsair CA-HS1 USB Headset) I wanna be able to execute a batch/script file who changes this for me so i don't have to "right click volume > playback devices > "Mark output device" and click "set default". I know it's a luxury problem, but hey, maybe I can learn something from someone? All help appreciated! 回答1: I

Difference between IISRESET and IIS Stop-Start command

感情迁移 提交于 2020-01-22 04:33:31
问题 Is there any difference between commands iisreset and iisreset /stop followed by iisreset /start ? 回答1: Take IISReset as a suite of commands that helps you manage IIS start / stop etc. Which means you need to specify option ( /switch ) what you want to do to carry any operation. Default behavior OR default switch is /restart with iisreset so you do not need to run command twice with /start and /stop . Hope this clarifies your question. Check this MS DOS help picture you will understand. 回答2: