for /d loop to robocopy subfolders to another directory is stuck on the first directory
I'm making a batch file to move and rename folders. but it gets stuck on the first folder and copies everything else to there
set ExamplePath=C:\Example set ExampleTarget=C:\Target for /d %%A in (%ExamplePath%\*) do ( if %%A==%Var0% do ( echo Copying %Var0% robocopy %%A %ExampleTarget%\%Var0% ) if %%A==%Var1% do ( echo Copying %Var1% robocopy %%A %ExampleTarget%\%Var1% )
See also questions close to this topic
Executing shell commands in parallel but limiting jobs (Windows without Cygwin)
Here is what I am trying to do. Suppose I have a program called
myprogram.exe, which I have to execute 1000 times.
Under Windows, I could usually do something as simple as:
for /L %n in (1,1,1000) do start /myfolder/myprogram.exe
However, suppose I only have 5 CPU threads I can devote to running the 1000 instances of
myprogram.exe, such that I launch only 5, then when one of these finishes another one is launched, etc until the whole 1000 end.
Under Linux and using GNU Parallel, I could simply do:
seq 1000 | parallel -N0 -j5 "nohup myprogram.exe"
How could I achieve something like that in Windows command line? Notice that in my case using Cygwin is not an option, so resorting to xargs and GNU Parallel under Windows are not options either.
Can't start program via SSH in windows 10
I enabled the latest openSSH on Windows 10. Successfully login using a key. However the command:
failed to run when I SSH from linux (nothing happens). If I ran it in the CMD from the windows itself (logged in using SSH,
ssh firstname.lastname@example.org -i "key"), it ran. Why is that?
Import subroutine code into FOR loop
I have a small batch file designed to read file names from a folder containing audio tracks and output them into a playlist. The program works well enough, but I had trouble getting the "write track names" code into the FOR loop -- I had to leave it as a subroutine or the batch file would exited prematurely. Is there any way to move those three lines into the FOR loop?
@echo off %~d1 cd %1 for %%* in (.) do set FOLDER="%%~nx*" set PLAYLIST=%FOLDER%.m3u for /f "tokens=*" %%g in ('dir /b *.flac *.mp3') do ( call :WRITE_TRACK_NAMES "%%g" ) goto :CHECKOUT :WRITE_TRACK_NAMES set "TRACK=%~nx1" echo %TRACK% >> %PLAYLIST% goto :EOF :CHECKOUT exit /b
github giving error about vim running in cmd
hint: Waiting for your editor to close the file... 0 [main] vim 7372 C:\Program Files\Git\usr\bin\vim.exe: *** fatal error - cmalloc would have returned NULL 334 [main] vim 7372 cygwin_exception::open_stackdumpfile: Dumping stack trace to vim.exe.stackdump Aborting commit due to empty commit message.
Note : closed all related file to the one I want to commit.
I am running
git commit -ato commit all changes I did on my project. I am just a noob in using github so bare with me. I did the hint that the cmd offer but I still get error.
How to fix above error.
When I first run the same command I was directed to a vim and I added the comment there. This time it does go to that screen just giving the error.
git statusgives me:
Clear CMD window from one of two functions, running at the same time
Recently I've learn how to write ASCII animation in Python. I would like to use it with other part of the program that is running at the same time. The problem is, animation use clear() function:
def clear(): os.system('cls' if os.name=='nt' else 'clear')
The problem about clear() is, that it delete everything from the screen, while I want just to delete inside of one function, and keep other function on the screen. How would you do that?
PS.Animation that I made in ASCI^^ https://onlinegdb.com/Bk0d2HyLX