Werbung: SecurityConsole.de verwaltet Ihre Computer mit Security Essentails aus der Cloud!
30 Tage kostenfrei testen und 20% Rabatt für Ihre Bestellung mit Promocode: WBF2685582
(Promocode gültig bis 31.12.2011)

Group:  English: Windows Server » microsoft.public.windows.server.scripting
Thread: Read a file name as an argument when running script.

HTVi
TV Discussion Newsgroups

Read a file name as an argument when running script.
Yas <yasar1[ at ]gmail.com> 6/28/2007 7:24:52 PM
Hello, I have a VBscript that processes data in a file given in a
certain format. Till now I've been hardwiring the file name at the top
of the script BUT...

How can I change the script so that it expect a filename as an
argument when its initiated eg cscript Script.vbs filename.txt
And to display a simple message on the command prompt if its run
without the file argument. showing the Usage of the script.


Many thanks for any help or advise :-)

Re: Read a file name as an argument when running script.
"Richard Mueller [MVP]" <rlmueller-nospam[ at ]ameritech.nospam.net> 6/28/2007 7:31:19 PM

"Yas" <yasar1[ at ]gmail.com> wrote in message
news:1183058692.353392.248640[ at ]q75g2000hsh.googlegroups.com...
[Quoted Text]
> Hello, I have a VBscript that processes data in a file given in a
> certain format. Till now I've been hardwiring the file name at the top
> of the script BUT...
>
> How can I change the script so that it expect a filename as an
> argument when its initiated eg cscript Script.vbs filename.txt
> And to display a simple message on the command prompt if its run
> without the file argument. showing the Usage of the script.
>
>
> Many thanks for any help or advise :-)
>

See my response in microsoft.public.scripting.vbscript.

--
Richard Mueller
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net
--


Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net
Suche nach Orten, Städten, Postleitzahlen, Vorwahlen, Kfz-Kennzeichen