Search found 177 matches

by amel27
16 Nov 2010 02:23
Forum: DOS Batch Forum
Topic: Dos Batch: Kill parallel jobs at the same time
Replies: 2
Views: 4186

Re: Dos Batch: Kill parallel jobs at the same time

Each (parallel) bat job run in its own process (CMD.EXE) and its own window, so you must ended each BAT separately (Ctrl+C)... Nevertheless, child BAT jobs can check if main job exists, and ended if not - by (unique) existing job window title or process name, see this thread for sample: http://www.d...
by amel27
15 Nov 2010 20:30
Forum: DOS Batch Forum
Topic: How to remove string from another string in batch
Replies: 13
Views: 13230

Re: How to remove string from another string in batch

I'm sure, it can be solved - yes we can Hmm... I'm in confusion, it is possible save this sequence of chars to VAR from file, but not from command line parameters... Unless not so? But we can bypass this problem for this special case... @echo off :LOOP SETLOCAL& set $a=%1 if not defined $a GoTo...
by amel27
15 Nov 2010 05:01
Forum: DOS Batch Forum
Topic: How to remove string from another string in batch
Replies: 13
Views: 13230

Re: How to remove string from another string in batch

jeb wrote:sorry amel27 but it fails with my standard password: abc"&"&def :wink:

Hi, jeb!.. You are ready enter this password via command line parameter?.. How? :)
in some case it is possible option of CMD tool, not CMD.EXE
by amel27
14 Nov 2010 22:46
Forum: DOS Batch Forum
Topic: How to remove string from another string in batch
Replies: 13
Views: 13230

Re: How to remove string from another string in batch

Similar, but long way: @echo off call :RmPass password=xxx server username=abc doaction call :RmPass server username=abc doaction password="xxx" call :RmPass server username=abc password="1&2" doaction call :RmPass server username=abc doaction EXIT :RmPass SETLOCAL EnableDela...
by amel27
14 Nov 2010 20:53
Forum: DOS Batch Forum
Topic: Invalid Drive Specification
Replies: 2
Views: 4594

Re: Invalid Drive Specification

probably You have no sufficient rights to remote admin shares, try manually:

Code: Select all

pushd \\<server name>\<drive>$
by amel27
14 Nov 2010 20:43
Forum: DOS Batch Forum
Topic: How to remove string from another string in batch
Replies: 13
Views: 13230

Re: How to remove string from another string in batch

DosItHelp , thanks A little more is needed when the command has quotes in it, which it doesn't in vivek4075 case. yes, it is probable case: @echo off call :RmPass password=xxx server username=abc doaction call :RmPass server username=abc doaction password="xxx" call :RmPass server usernam...
by amel27
14 Nov 2010 05:47
Forum: DOS Batch Forum
Topic: How to remove string from another string in batch
Replies: 13
Views: 13230

Re: How to remove string from another string in batch

if command contains password then every thing is fine but some time this will not be the part of string so in this case whatever %command% contains this will print two time @echo off call :RmPass password=xxx server username=abc doaction call :RmPass server username=abc doaction password=xxx call :...
by amel27
13 Nov 2010 02:13
Forum: DOS Batch Forum
Topic: delete specific directory
Replies: 1
Views: 3483

Re: delete specific directory

Code: Select all

for /f "delims=" %%a in ('dir /ad/b/s C:\Debug') do echo rd /q/s "%%a"

remove ECHO command for delete
by amel27
12 Nov 2010 03:00
Forum: DOS Batch Forum
Topic: Change Homedir folder
Replies: 2
Views: 4260

Re: Change Homedir folder

Code: Select all

set $OU=ou=hc gebruikers,ou=hc,DC=hc,dc=tmg,dc=lan
for /f "usebackq delims=" %%a in ("c:\users.txt") do (
dsquery user "%$OU%" -scope subtree -samid %%a|dsmod user -hmdir "\\hc-file02\homedirs\%%a"
)
by amel27
12 Nov 2010 02:26
Forum: DOS Batch Forum
Topic: delete spaces from a filename before using it as variable
Replies: 2
Views: 4474

Re: delete spaces from a filename before using it as variabl

you must add dbl quotes in all commands with file names, if not present:

%~n1 -> "%~n1"
%~dpn1 -> "%~dpn1"
%~dp1 -> "%~dp1"
by amel27
12 Nov 2010 02:20
Forum: DOS Batch Forum
Topic: How do I remove a certain part of a variable?
Replies: 1
Views: 3268

Re: How do I remove a certain part of a variable?

Code: Select all

@set var=11/11/2010
@set var=%var:/=%

@echo %var%
@pause>nul
by amel27
12 Nov 2010 02:16
Forum: DOS Batch Forum
Topic: How to remove string from another string in batch
Replies: 13
Views: 13230

Re: How to remove string from another string in batch

Code: Select all

set $x=%command: password=&rem.%
for /f "tokens=1*" %%a in ("%command:* password=%") do set "command=%$x% %%b"
by amel27
09 Nov 2010 18:30
Forum: DOS Batch Forum
Topic: Dir output into a file in one row with comma seperation
Replies: 2
Views: 4188

Re: Dir output into a file in one row with comma seperation

I am having trouble getting the extracted numbers into a comma delimited csv file in one row only, can anyone help please. sample via "set /p" triks: @echo off SetLocal EnableDelayedExpansion cd /D D:\Adsoft\SIMS\ManifestFiles for /f "delims=" %%a in ('dir /o-d/b "*.mfs&quo...
by amel27
09 Nov 2010 04:11
Forum: DOS Batch Forum
Topic: How to read folder that contains sub-folders
Replies: 1
Views: 3133

Re: How to read folder that contains sub-folders

Code: Select all

@echo off
cls

set counter=0

:loop
set /a counter+=1
set "mydisk=c:\test\%counter%"

echo %mydisk%
if %counter% lss 7 goto loop

pause>nul