🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: free.it.visual-basic
Article #375

Re: Vbscript - dos

#375
From: AntFast
Date: Sun, 12 Nov 2006 11:42
55 lines
3104 bytes
"Rafunk" <rafunkSPAM@NOTHANKSlibero.it> ha scritto nel messaggio 
news:4556ef21$0$13769$4fafbaef@reader3.news.tin.it...
> AntFast wrote:
>> Ciao a tutti
>> Dove posso trovare informazioni per poter
>> scrivere in  vbscript i vecchi comandi dos ?
>> (tipo dir > listafile.txt, ecc...)
>> Sto appena imparando che vbscript e' usato
>> al posto del vecchio linguaggio dos per i
>> file.bat...
>> Grazie in anticipo per l'eventuale risposta.
>> AntFast
>
> Innanzitutto il "vecchio linguaggio dos per i file .bat" � ancora vivo e
> vegeto in tutte le versioni di Windows.
> Certamente VBScript � decisamente pi� potente, ma in quanto tale richiede
> spesso molte pi� istruzioni per realizzare operazioni anche semplici come
> quella che hai citato tu (dir > listafile.txt)
> Qualcosa del genere:
>
> dim fso, ts, fld, file, wsh
>    set wsh=CreateObject("WScript.Shell")
>    set fso=CreateObject("Scripting.FileSystemObject")
>    set ts=fso.CreateTextFile("listafile.txt", True)
>    set fld=fso.GetFolder(wsh.CurrentDirectory)
>    for each file in fld.Files
>        ts.WriteLine file.DateLastModified & "  " & file.Name
>    next
>    ts.Close
>
> Qualche link utile
> http://msdn2.microsoft.com/en-US/library/sx7b3k7y(VS.80).aspx
> http://tinyurl.com/yekk8h
> http://www.vbscript.it/HomePage/Default.asp
> http://www.webmasterpoint.org/vbscript/home.asp
>
> Bye
>
> Raf
>

Ciao Rafunk e davvero grazie di cuore.
Se posso approfittare della tua conoscenza...
Mi capita spesso di dover rinominare molti
file in una cartella togliendo a tutti i primi "n" caratteri.
Nell'esempio sono da togliere i primi 16 caratteri:
                    da                                     a
NomeStessoAlbum-File1.mp3       File1.mp3
NomeStessoAlbum-File2.mp3       File2.mp3
NomeStessoAlbum-File3.mp3       File3.mp3
ecc....
Opteresti per un file batch o per vbscript ?
Grazie in anticpo per l'eventuale risposta.
AntFast
Technical Details
Message-ID: <EMD5h.2756$mZ5.2516@tornado.fastwebnet.it>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!tornado.fastwebnet.it!53ab2750!not-for-mail
References: <wGu5h.2467$mZ5.421@tornado.fastwebnet.it> <4556ef21$0$13769$4fafbaef@reader3.news.tin.it>

Show Full Headers
Complete Article Headers
X-Google-Thread: f94ee,f85f7917273de692
X-Google-Attributes: gidf94ee,public
X-Google-Language: ITALIAN,ASCII
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!tornado.fastwebnet.it!53ab2750!not-for-mail
From: "AntFast" <cianto@fastwebnet.it>
Newsgroups: free.it.visual-basic
References: <wGu5h.2467$mZ5.421@tornado.fastwebnet.it> <4556ef21$0$13769$4fafbaef@reader3.news.tin.it>
Subject: Re: Vbscript - dos
Lines: 60
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
Message-ID: <EMD5h.2756$mZ5.2516@tornado.fastwebnet.it>
Date: Sun, 12 Nov 2006 12:42:38 +0100
NNTP-Posting-Host: 1.242.164.53
X-Complaints-To: newsmaster@fastweb.it
X-Trace: tornado.fastwebnet.it 1163331748 1.242.164.53 (Sun, 12 Nov 2006 12:42:28 CET)
NNTP-Posting-Date: Sun, 12 Nov 2006 12:42:28 CET