Discussion forum for all Windows batch related topics.
Moderator: DosItHelp
-
tirano
- Posts: 8
- Joined: 12 Sep 2009 23:44
-
Contact:
#1
Post
by tirano » 04 Nov 2009 09:44
ex:
i have folder
f1 = 001
f2 = a01
f3 = ab
f4 = 4
all folder have file pdf i try use code in bellow it can compress but copy file bat to all folder
for %%I in (*.pdf) do "%ProgramFiles%\WinRAR\WINRAR.exe" a -ep1 -r -v102400 "%%I.rar" -ibck "%%I" -hp"khmerw"
i 1 run 1 bat compress all file in folder and not change path
ex:
f1 = 001\khmer.pdf
=> f1 = 001\khmer.rar
f2 = a01\learn.pdf
=> f2 = a01\learn.rar
-
!k
- Expert
- Posts: 378
- Joined: 17 Oct 2009 08:30
- Location: Russia
#3
Post
by !k » 08 Nov 2009 05:18
I misunderstood your English, but maybe this is what you need?
Code: Select all
for %%I in (001\*.pdf a01\*.pdf ab\*.pdf 4\*.pdf) do start "" "%ProgramFiles%\WinRAR\WINRAR.exe" a -ep1 -r -v102400 "%%I.rar" -ibck "%%I" -hp"khmerw"
-
tirano
- Posts: 8
- Joined: 12 Sep 2009 23:44
-
Contact:
#4
Post
by tirano » 08 Nov 2009 17:44
sorry sir my english poor
thnx for reply
for %%I in (
001\*.pdf
a01\*.pdf
ab\*.pdf 4\*.pdf) do start "" "%ProgramFiles%\WinRAR\WINRAR.exe" a -ep1 -r -v102400 "%%I.rar" -ibck "%%I" -hp"khmerw"
all text bold generate all time when compress file.
i need
-
!k
- Expert
- Posts: 378
- Joined: 17 Oct 2009 08:30
- Location: Russia
#5
Post
by !k » 09 Nov 2009 07:39
Code: Select all
for /f %%I in ('dir /b /s *.pdf') do start "" "%ProgramFiles%\WinRAR\WINRAR.exe" a -ep1 -r -v102400 "%%I.rar" -ibck "%%I" -hp"khmerw"
-
tirano
- Posts: 8
- Joined: 12 Sep 2009 23:44
-
Contact:
#6
Post
by tirano » 09 Nov 2009 08:51
thnx
how to create have function wait to archive. (run 1 by 1, not run all)
-
!k
- Expert
- Posts: 378
- Joined: 17 Oct 2009 08:30
- Location: Russia
#7
Post
by !k » 09 Nov 2009 09:15
More better
Code: Select all
for /f %%I in ('dir /b /s *.pdf') do start "" /wait "%ProgramFiles%\WinRAR\WINRAR.exe" a -t -df -ep1 -r -v102400 -ibck -hp"khmerw" -- "%%I.rar" "%%I"
Last edited by
!k on 09 Nov 2009 14:28, edited 1 time in total.
-
tirano
- Posts: 8
- Joined: 12 Sep 2009 23:44
-
Contact:
#8
Post
by tirano » 09 Nov 2009 09:24
i have 1 problem
folder have space of file name and folder
-
tirano
- Posts: 8
- Joined: 12 Sep 2009 23:44
-
Contact:
#9
Post
by tirano » 10 Nov 2009 06:52
!k wrote:More better
Code: Select all
for /f %%I in ('dir /b /s *.pdf') do start "" /wait "%ProgramFiles%\WinRAR\WINRAR.exe" a -t -df -ep1 -r -v102400 -ibck -hp"khmerw" -- "%%I.rar" "%%I"
thank big man
-
tirano
- Posts: 8
- Joined: 12 Sep 2009 23:44
-
Contact:
#10
Post
by tirano » 10 Nov 2009 21:14
!k wrote:More better
Code: Select all
for /f %%I in ('dir /b /s *.pdf') do start "" /wait "%ProgramFiles%\WinRAR\WINRAR.exe" a -t -df -ep1 -r -v102400 -ibck -hp"khmerw" -- "%%I.rar" "%%I"
change -df to -dr for move file to recycle bin