Tagged Questions

The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
2answers
43 views

How to Make Directories Based on File Names, and Move These Files Inside Them using CMD?

As I said, I've Some *.Xml Files in one folder, I want to move them to sub-dirs based on their names . But, I need two more things :- 1- I've to apply/run the command from a parent directory, not ...
1
vote
1answer
22 views

Powershell - Grabing Mailbox Stats : How can I look at multiple OUs?

I have this Powershell code that grabs the mailbox stats from one OrganisationalUnit but how could I grab it from two others without running the code again seperately. How would I create an array of ...
1
vote
1answer
63 views

How to find all executable files in a windows directory?

I'm not sure of the commands or syntax needed to complete this but I thought it would be easy considering what I need it to do. Essentially I want to search C:\users\ for .exe files and output the ...
0
votes
1answer
13 views

Iterate over files, ignoring filenames with a hyphen

Background Converting images from RGB to grayscale. A number of files exist in different directories. For example: outline/trigon.png outline/oval-bw.png outline/crescent-bw.png ...
0
votes
1answer
35 views

How to print index in a 'for-loop' being executed in remote host through SSH?

I want to ssh into a remote host, and then execute a for loop that goes through sequence of numbers to control number of different nodes. ssh user@host /bin/bash << EOF for i in {1..10} do echo ...
0
votes
1answer
16 views

Word 2010: Loop in Active Table Cell

UPDATE: I am now working from the top of the Active Cell with this code: Selection.EndKey Unit:=wdLine Selection.TypeText Text:=", " Selection.Delete Unit:=wdCharacter, Count:=1 I need it to loop ...
0
votes
1answer
66 views

batch: wmic difficulty in FOR loop

I'm trying to learn to write batch files so I can be more useful at work, but I'm having some difficulty with wmic inside a for loop. (even if there is a better way to do this with PowerShell or ...
0
votes
1answer
689 views

Copy from sheet2 to sheet1 based on if values match

The goal of this code is to iterate through a column in sheet1 and check to see if each value matches that of values in a row in sheet2. If the value matches, copy 5 rows of information from sheet2 ...
3
votes
2answers
70 views

How to work around Bash for loop not exiting when a subcommand errors?

I have a for-loop in a shell script a la: #!/bin/bash set -u set -e for l in sh rb py php java cs; do (cd $l; ./run-tests.sh) done The intent is to have the for-loop die in a fire when any one of ...
0
votes
1answer
141 views

Need help creating a .bat file to execute SAS jobs

Using Windows 7, I need a .bat file that will execute files in a folder whenever I put them in there. for example I want it to execute files with a .sas suffix and then rename them once executed. I ...
0
votes
1answer
110 views

Append an index number to a variable name in bash?

I am trying to loop through numbered variables but am having a hard time appending the loop index number to the base variable name. Code follows, using a 2-iteration example: #ENTER TOTAL NUMBER OF ...
1
vote
1answer
140 views

Problems using a batch file For loop to feed .tifs into a GIS process (gdal_polygonize)

Thanks in advance for your help with this. I've been reading, experimenting, and banging my head against the wall for a couple days on this, and could really use some assistance. This is my first ...
-1
votes
1answer
57 views

Pass a variable in skip of for loop [closed]

Can we pass a variable in for loop as in below example: @ECHO off SETLOCAL ENABLEDELAYEDEXPANSION set /A counter=6 echo !counter! for /f "skip=!counter! tokens=1-18 delims=]" %%A in ...
2
votes
1answer
62 views

For command not processing lines from a file

I dumped all the physical network GUIDs to a file via: wmic nic where "PhysicalAdapter = 'TRUE'" get GUID > networkAdapterGUIDs.txt When I try to read the file and echo out its contents nothing ...
1
vote
2answers
56 views

why does this work in a shell for loop but not by itself

why does this work for X in A* ; do cp $X/output.txt output/$X.txt ; done but not this cp A*/output.txt output/A*.txt For copying the output.txt file from multiple folders called A1, A2, A3, ...