Jump to content

Batch Dosyası Ile Birden Fazla Yeni Klasör Oluştur


secoo140
 Share

Recommended Posts

merhaba

 

bir tane belvedere diye programım var.

 

çeşitli dosyaları çeşitli yerlere taşıyor. aynı IDM gibi

 

bunun için

 

%currentuser%documents

içine

 

md pdf

md excel

md word

 

 

sonra

 

videos içine 

 

md indirilenler

 

gibi klasörler oluşturmam gerekiyor.

 

değişkenler denilen bu %---% değerlerini girmeyi bilmediğim için kendim yapamadım.

yardım edersniz sevinirim

 

Link to comment
Share on other sites

Ya da

 

bilgisayar > özellikler > gelişmiş sistem ayarları > ortam değişkenleri

 

bölümünden sistemin ve senin kullanıcına ait sistem değişkenlerini görebilir. Yeni değişkenler tanımlayabilir ve hangi değişkenin hangi yola tekabül ettiğini görebilirsin ;)

Link to comment
Share on other sites

SET komutu için allah razı olsun :D

 

bu arada

 

şimdi şu aşamadayım

cd %homepath%
cd belgelerim
md pdf
md excel
md word
md slaytlar
md Rar
md Exe

cd %homepath%
cd videos
md indirilenler

ilki çalışıyor

 

ikinci ne hikmet çalışmıyor...b

 

bakalım araştırıyorum

Link to comment
Share on other sites

Şöyle yapabilirsin

Echo off
Choice /C CDEF /M "Dosyalar hangi sürücüye aktarılsın ? [C:,D:,E:,F:]"
if errorlevel 1 goto CC
if errorlevel 2 goto DD
if errorlevel 3 goto EE
if errorlevel 4 goto FF

:CC
Copy /Y /V %userprofile%\documents\PDF C:\PDF
goto END
:DD
Copy /Y /V %userprofile%\documents\PDF D:\PDF
goto END
:EE
Copy /Y /V %userprofile%\documents\PDF E:\PDF
goto END
:FF
Copy /Y /V %userprofile%\documents\PDF F:\PDF
goto END
:END
Echo Tüm dosyalar kopyalandı
Pause
Exit

Haydi kolay gele !

Link to comment
Share on other sites

Echo off
Choice /C CDEF /M "Dosyalar hangi sürücüye aktarılsın ? [C:,D:,E:,F:]"
if errorlevel 1 goto CC
if errorlevel 2 goto DD
if errorlevel 3 goto EE
if errorlevel 4 goto FF
 
:CC
Copy /Y /V %userprofile%\documents C:\YEDEK
Copy /Y /V %userprofile%\downloads C:\YEDEK\1
Copy /Y /V %userprofile%\music C:\YEDEK\2
Copy /Y /V %userprofile%\videos C:\YEDEK\3
Copy /Y /V %userprofile%\pictures C:\YEDEK\4
goto END
:DD
Copy /Y /V %userprofile%\documents D:\YEDEK
Copy /Y /V %userprofile%\downloads D:\YEDEK\1
Copy /Y /V %userprofile%\music D:\YEDEK\2
Copy /Y /V %userprofile%\videos D:\YEDEK\3
Copy /Y /V %userprofile%\pictures D:\YEDEK\4
goto END
:EE
Copy /Y /V %userprofile%\documents E:\YEDEK
Copy /Y /V %userprofile%\downloads E:\YEDEK\1
Copy /Y /V %userprofile%\music E:\YEDEK\2
Copy /Y /V %userprofile%\videos E:\YEDEK\3
Copy /Y /V %userprofile%\pictures E:\YEDEK\4
goto END
:FF
Copy /Y /V %userprofile%\documents F:\YEDEK
Copy /Y /V %userprofile%\downloads F:\YEDEK\1
Copy /Y /V %userprofile%\music F:\YEDEK\2
Copy /Y /V %userprofile%\videos F:\YEDEK\3
Copy /Y /V %userprofile%\pictures F:\YEDEK\4
goto END
:END
Echo Tüm dosyalar kopyalandı
Pause
Exit

BU hale getirdim hemen ama çalışmadı. xcopy mi yazmam gerekiyor acaba

Link to comment
Share on other sites

klasör yapar  kopyalamak istediğin içeriği tekrar klasörü yapıp içeriğini kopyalayıp atar.

mkdir %USERPROFILE%\DOCUMENTS\pdf
mkdir %USERPROFILE%\DOCUMENTS\word
mkdir %USERPROFILE%\DOCUMENTS\excell
mkdir %USERPROFILE%\VIDEOS\indirilenler

mkdir D:\pdf
xcopy %USERPROFILE%\DOCUMENTS\pdf  D:\pdf

pause
Link to comment
Share on other sites

Choice kodlarını sadece örnek olarak verdim. Geri kalan kod işlemlerini de kendiniz yapmanız gerekli. İster XCOPY ile yapın, ister for döngüsü ile yapın farketmez, benim verdiğim sadece işleyiş ile ilgili bir örnek sadece, bunu düzenlemek ve geliştirmek sizin elinizde !

 

Haydi kolay gele !

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...