🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: come eseguire un comando shell in VB?

#4080
From: baby2
Date: Thu, 12 Apr 2001 15:09
36 lines
1955 bytes
On Mon, 9 Apr 2001 19:56:47 +0200, "jagerhans"
<jagerhans@tiscalinet.it> wrote:

>Se qualcuno mi potesse spiegare perch� non riesco ad eseguire il seguente
>codice, mi farebbe un garnde piacere.
>
>Private Sub Command1_Click()
>Dim copy
>copy = Shell("c:\testo.txt C:\folder1", vbHide)
>End Sub
>
Perch� sbagli la sintassi. La funzione shell ha come argomento un file
eseguibile o di comandi. Per capirci un file con estensione EXE,BAT o
COM. Il risultato che ti restituisce identifica, se la funzione �
andata a buon fine,  il numero di Task in Windows. Se c'� un errore la
funzione da come risultato 0.
Ad esempio, se devi aprire un file con il notepad la sintassi �:
.
.
Dim RetVal as long
RetVal = Shell("C:\Windows\Notepad.exe Testo.txt",VbNormalFocus)
.
.
Se vuoi copiare un file in VB esiste l'istruzione 
FileCopy <Origine>,<Destinazione>


>ed ecco il risultato:
>
>Runtume error 53
>File not found
>
>eppure il file esiste.
>Grazie a tutti
>
>
Technical Details
Message-ID: <3ad5c2e9.9941557@news.tiscalinet.it>
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!cyclone-sjo1.usenetserver.com!news-out-sjo.usenetserver.com!europa.netcrusader.net!4.1.16.34!cpk-news-hub1.bbnplanet.com!frnkge1-snf1.gtei.net!news.gtei.net!draco.tiscalinet.it!not-for-mail
References: <9ast1l$v86$1@pegasus.tiscalinet.it>

Show Full Headers
Complete Article Headers
X-Google-Language: ITALIAN,ASCII
X-Google-Thread: f94ee,6bd04ba661a9ff84
X-Google-Attributes: gidf94ee,public
X-Google-ArrivalTime: 2001-04-12 08:10:05 PST
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!cyclone-sjo1.usenetserver.com!news-out-sjo.usenetserver.com!europa.netcrusader.net!4.1.16.34!cpk-news-hub1.bbnplanet.com!frnkge1-snf1.gtei.net!news.gtei.net!draco.tiscalinet.it!not-for-mail
From: baby2@virgilio.it
Newsgroups: free.it.visual-basic
Subject: Re: come eseguire un comando shell in VB?
Date: Thu, 12 Apr 2001 15:09:29 GMT
Organization: Tiscali Spa
Lines: 37
Message-ID: <3ad5c2e9.9941557@news.tiscalinet.it>
References: <9ast1l$v86$1@pegasus.tiscalinet.it>
NNTP-Posting-Host: pd1-292.dialup.tiscalinet.it
X-Trace: pegasus.tiscalinet.it 987088034 12596 62.10.18.36 (12 Apr 2001 15:07:14 GMT)
X-Complaints-To: newsadmin@tiscali.it
NNTP-Posting-Date: 12 Apr 2001 15:07:14 GMT
X-Newsreader: Forte Free Agent 1.21/32.243