Jump to content

Dosya Ismini Bilmeden O Dosyayı Çalıştırmak?


djonur007

Recommended Posts

Selamun aleykum arkadaşlar;

Benim bir sorum var. Şimdi bir klasör altında 3-5 tane exe uzantılı program var, ama isimlerini bilmiyoruz. Bu programları [b]sırayla[/b] nasıl çalıştırabiliriz?(katılımsız olarak.)
Link to comment
Share on other sites

AMS ile bu yapilabilir:

[quote]tAra = File.Find("Autoplay\\Docs", "*.exe", false, false, nil, nil)

for i in pairs(tAra) do
File.Run(tAra[i], "", "Autoplay\\Docs", SW_SHOWNORMAL, true)
end[/quote]

bu kod docs klasorundeki exe dosyalarını sırayla çalıştıracaktır.

Link to comment
Share on other sites

Autoit ile kısaca;
[codebox]#NoTrayIcon ;Tray iconunu saklayalım

_FIND_RUN_EXE(@ScriptDir) ;Sırasıyla çalıştır

Func _FIND_RUN_EXE($LOCATION)
If StringRight($LOCATION,1) <> "\" Then $LOCATION &= "\"
Local $search = FileFindFirstFile($LOCATION & "*.exe"),$file
If $search <> -1 Then
While 1
$file = FileFindNextFile($search)
If @error Then ExitLoop
RunWait($LOCATION & $file)
WEnd
EndIf
FileClose($search)
EndFunc[/codebox]
Tabi ben satırları biraz uzattım :)

Link to comment
Share on other sites

[quote name='KintaRo' date='27 Kasım 2010 - 12:36 ' timestamp='1290854816' post='917727']
kısaca bumu? vay be, iyiki uzun bişey sormadı arkadaş :D
[/quote]

Hocam senin kodlara göre uzun olabilir ama boyut olarak @Blue_Life hocamınki daha küçük :)

Herkese teşekkürler...

@3yl3mci bak yapılabilirmiş. :D

Link to comment
Share on other sites

@KintaRo

Hobi olarak başladık, ufak tefek bir şeyler yaptıkça gelişiyor...
Aslında autoit ile yüklenen udf leri kullansak (library) kodlar dahada kısalır.

@djonur007

Al sana cmd için kısa kod. Tabi benim için autoit daha stabil.
[codebox]@Echo Off
for %%U in (*.exe) DO (
Start %%U
)[/codebox]

Link to comment
Share on other sites

[quote name='blue_life' date='27 Kasım 2010 - 13:07 ' timestamp='1290856652' post='917741']
Al sana cmd için kısa kod. Tabi benim için autoit daha stabil.
[codebox]@Echo Off
for %%U in (*.exe) DO (
Start %%U
)[/codebox]
[/quote]

bu kod guzelmiş :) yalnız [b]start /wait %%U[/b] olmayacak mı o?

Link to comment
Share on other sites

[quote name='KintaRo' date='27 Kasım 2010 - 13:15 ' timestamp='1290857135' post='917747']
o zaman ams ye devam eheh
[/quote]

bunları çöpe atmayalım :)
[php]
#NoTrayIcon ;Tray iconunu saklayalım

_FIND_RUN_EXE(@ScriptDir) ;Sırasıyla çalıştır

Func _FIND_RUN_EXE($LOCATION)
If StringRight($LOCATION,1) <> "\" Then $LOCATION &= "\"
Local $search = FileFindFirstFile($LOCATION & "*.exe"),$file
If $search <> -1 Then
While 1
$file = FileFindNextFile($search)
If @error Then ExitLoop
RunWait($LOCATION & $file)
WEnd
EndIf
FileClose($search)
EndFunc
[/php]

Link to comment
Share on other sites

vay arkadaş iki dakikada amma kaynatmışsınız. kintarocum aslında bluelife ın kodları da 5 satıra iner ama hata kontrolleri vs. yaptığı için bu kadar uzamış kod.
[code]$search = FileFindFirstFile($LOCATION & "*.exe"),$file
While 1
$file = FileFindNextFile($search)
RunWait($LOCATION & $file)
WEnd
fileClose($search)[/code]
diğer cmd komutuna gelince
for %%U in (*.exe) DO (
%%U
)
komut böyle de olabilirdi. ama eğer katılımsız kurulumda kullanıcaksanız start /wait le kullanmalısınız.
@Echo Off
for %%U in (*.exe) DO (
Start /wait %%U
)
yoksa kurulumlar birbirini takip etmeyebilir.malum bazı kurulumlar başka bir kurulum aktifken kuruluma devam etmeyip kendini durduruyor.





Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...