Search found 15 matches

by atamo
01 Feb 2012 11:20
Forum: DOS Batch Forum
Topic: replace a substring by position
Replies: 6
Views: 7769

Re: replace a substring by position

thank's your fast help :oops:

Code: Select all

echo !var:%var:~1,1%=OK!  work nice that I want, get   aOKdfg



but in this case why !var:s=OK! don't expanded ?

Code: Select all

echo !var:!var:~1,1!=OK!    don't work, I get       !var:s=OK! 
by atamo
01 Feb 2012 08:38
Forum: DOS Batch Forum
Topic: replace a substring by position
Replies: 6
Views: 7769

replace a substring by position

I want to replace a string second character with somthing else, e.g. :

set cmd /E:ON
set var=asdfg
echo !var:!var:~1,1!=OK!

unfortunately don't replace s with OK , the code display

Code: Select all

!var:s=OK!
but I want

Code: Select all

aOKdfg


thank's your help .
by atamo
11 Apr 2011 13:41
Forum: DOS Batch Forum
Topic: Make Directory with space
Replies: 6
Views: 7390

Re: Make Directory with space

you're right, thanks for detailed explanation , :mrgreen:
by atamo
11 Apr 2011 12:48
Forum: DOS Batch Forum
Topic: Make Directory with space
Replies: 6
Views: 7390

Re: Make Directory with space

Thank's , I forget it..... :oops:


but

Code: Select all

MD %programfiles%\Folder

why don't work ?
by atamo
11 Apr 2011 12:26
Forum: DOS Batch Forum
Topic: Make Directory with space
Replies: 6
Views: 7390

Make Directory with space

Hy I need to copy some file in a subfolder of Program Files ,but because Program Files contain a space can't create the directory. md c:\Program Files\ProgramName or md %ProgramFiles%\ProgramName Create a new folder with Program's name but I need to make a directory in Program Files Any ideea ???
by atamo
05 Apr 2011 03:58
Forum: DOS Batch Forum
Topic: RENAME using redirection operators......
Replies: 2
Views: 4894

Thank's the meticulous explain :P

dbenham wrote:It requires two arguments, source and destination.


unfortunately the next code also don't work:

Code: Select all

ren < newname.txt
where newname.txt contain a single line with two parameters: old.rar new.rar
by atamo
01 Apr 2011 07:52
Forum: DOS Batch Forum
Topic: RENAME using redirection operators......
Replies: 2
Views: 4894

RENAME using redirection operators......

Hy I want to rename a file with a name from a text file, e.g. ren old.rar < newname.txt where newname.txt contain a single line: new.rar I get syntax error if I use for /f %i in (c:\newname.txt) do ren c:\old.rar %i work fine ... but why can't I use redirection operators, Which is the good syntax
by atamo
16 Mar 2011 07:50
Forum: DOS Batch Forum
Topic: Save to USB memory stick
Replies: 6
Views: 8384

Re: Save to USB memory stick

with usebackq option work nice, Thank's Again :P
by atamo
15 Mar 2011 13:48
Forum: DOS Batch Forum
Topic: Save to USB memory stick
Replies: 6
Views: 8384

Re: Save to USB memory stick

unfortunately

') was unexpected at this time

:(
by atamo
15 Mar 2011 12:44
Forum: DOS Batch Forum
Topic: Save to USB memory stick
Replies: 6
Views: 8384

Re: Save to USB memory stick

thank's !k the great HELP Because MediaType for USB can be 0, 11 or sometime null , I want to use for filter deviceID<> 'A:' wmic logicaldisk where (drivetype=2 and deviceID^<^>'A:') get deviceID work nice, return>> DeviceID P: but I need only second line ,and the bottom code don't work (Of course ...
by atamo
08 Mar 2011 14:23
Forum: DOS Batch Forum
Topic: IF command use logical operators....
Replies: 2
Views: 5293

Re: IF command use logical operators....

nice catch

:lol: :P :lol:

thank you very much.
by atamo
08 Mar 2011 13:40
Forum: DOS Batch Forum
Topic: IF command use logical operators....
Replies: 2
Views: 5293

IF command use logical operators....

Hy I've two conditions cond1 and cond2 , if both conditions are true do command1 if someone is false do command2. is any chance to introduce these two conditions in "if" command using logical operators for now use this solution, but seems too long ..... if cond1 ( if cond2 ( command1) else...
by atamo
23 Feb 2011 03:08
Forum: DOS Batch Forum
Topic: Save to USB memory stick
Replies: 6
Views: 8384

Save to USB memory stick

Hy I want to save my daily works from a folder named TODAY to a folder called today's date for example 28.02.2011 created on USB Memory Stick. The big problem is that the Stick Drive letter is sometime H:, sometime K:, sometime I: >>>>> so I dont know the Stick Drive Letter... I want to write this c...
by atamo
13 Feb 2011 16:26
Forum: DOS Batch Forum
Topic: bach file for uninstall a program
Replies: 2
Views: 3579

Re: bach file for uninstall a program

my fault ,I forget the redirect caracters ,uninstall work nice with your suggestion.


thank's the quick help , :mrgreen:
by atamo
13 Feb 2011 13:35
Forum: DOS Batch Forum
Topic: bach file for uninstall a program
Replies: 2
Views: 3579

bach file for uninstall a program

hello I want to uninstall a program using a command file. I get uninstall information from HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ if run it from command line work perfect but if I put in a delete.cmd file I have error " file not found. " uninstall info is &...