Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > it.comp.lang.visual-basic > #18943

aiuto su codice vbs

From Tommy <barta@quipo.it>
Newsgroups it.comp.lang.visual-basic
Subject aiuto su codice vbs
Date 2016-12-29 15:20 +0100
Organization Aioe.org NNTP Server
Message-ID <o43643$ha1$1@gioia.aioe.org> (permalink)

Show all headers | View raw


ciao, una cosa da vero principiante...

ho il sequente pezzo di codice:


		if Fso.FolderExists ("D:\000") then
                 FSO.CopyFolder "D:\000", CopiaCDsuHD
		end if

		if Fso.FolderExists ("D:\CDSURF") then
		FSO.CopyFolder "D:\CDSURF", CopiaCDsuHD
		end if

                 if Fso.FolderExists ("D:\DATA") then
		FSO.CopyFolder "D:\DATA", CopiaCDsuHD
		end if

		if Fso.FolderExists ("D:\DICOM") then
		FSO.CopyFolder "D:\DICOM", CopiaCDsuHD
		end if

		if Fso.FolderExists ("D:\FILESET") then
		FSO.CopyFolder "D:\FILESET", CopiaCDsuHD
		end if

		if Fso.FolderExists ("D:\IMAGES") then
		FSO.CopyFolder "D:\IMAGES", CopiaCDsuHD
		end if

		if Fso.FolderExists ("D:\studies") then
		FSO.CopyFolder "D:\studies", CopiaCDsuHD
		end if

		if Fso.FolderExists ("D:\_STUDIES") then
		FSO.CopyFolder "D:\_STUDIES", CopiaCDsuHD
		end if

		if Fso.FolderExists ("D:\study000") then
		FSO.CopyFolder "D:\study000", CopiaCDsuHD
		end if

per ognuna delle condizioni, qualora venga trovata una delle 9 cartelle 
elencate (es. "D:\DICOM" o "D:\IMAGES" ecc. ecc.)
tale cartella viene copiata su hard disk tramite il comando CopiaCDsuHD

è possibile riscrivere il codice in modo più "sintetico" ovvero anzichè 
ripetere 9 blocchi di codice quasi uguali, averne uno solo che dice che 
qualora una qualunque di quelle 9 cartelle sia presente su CD va 
ricopiata su HD?

ho provato con
if Fso.FolderExists ("D:\IMAGES") or ("D:\DICOM") or ecc. ecc.

ma non funzionava

grazie Tommy

Back to it.comp.lang.visual-basic | Previous | NextNext in thread | Find similar


Thread

aiuto su codice vbs Tommy <barta@quipo.it> - 2016-12-29 15:20 +0100
  Re: aiuto su codice vbs Luca D <antaniserse@yahoo.it> - 2016-12-29 16:28 -0800
  Re: aiuto su codice vbs Luca D <antaniserse@yahoo.it> - 2016-12-29 16:30 -0800
    Re: aiuto su codice vbs Tommy <barta@quipo.it> - 2017-01-02 21:30 +0100

csiph-web