2010-10-27 21 views
5

Bir toplu iş dosyasına VBScript gömmek mümkün mü?Windows toplu iş dosyasının içine VBScript'i gömün

Şu anda

cscript //NoLogo MyScript.vbs 

kullanarak .VBS dosyasını çağıran bir .CMD dosyası var ama sadece tek bir .CMD dosyasını dağıtmak için tercih ediyorum.


DÜZENLEME: Hiç bir ara dosyası oluşturmadan bunun nasıl yapılacağı ile ilgili cevapları ile benzer bir soru var: Nerede bir toplu ilginç bir hack Is it possible to embed and execute VBScript within a batch file without using a temporary file?

+0

Bulunan betik, (VBScript olan) etiketler için kendini tarar ve bunu http://www.computerhope.com/forum/index.php?topic=103686.0 –

+0

yürüten yeni bir VBS dosyasına yazar. ch – lrl

+0

Olası kopyası [Geçici dosya kullanmadan bir toplu iş dosyası içinde VBScript gömmek ve yürütmek mümkün mü?] (http://stackoverflow.com/questions/9074476/is-it-possible-to-embed-and- execute-vbscript-içinde-a-batch-dosyası-kullanmadan-a) – aschipfl

cevap

8

http://www.computerhope.com/forum/index.php?topic=103686.0

@echo off 
echo This is batch 
:wscript.echo "This VBScript" 
:wscript.echo "Today is " & day(date) & "-" & month(date) & "-" & year(date) 
findstr "^:" "%~sf0">temp.vbs & cscript //nologo temp.vbs & del temp.vbs 
echo This is batch again 
+0

Yep bulundu. –

+0

Google oldukça iyi çalışıyor, ha? – drudge

İlgili konular