Set fso=CreateObject("Scripting.FileSystemObject")
DesktopPath=CreateObject("WScript.Shell").SpecialFolders("Desktop")
'Files count
msgbox "the no of files on the desktop is:"
&fso.GetFolder(DesktopPath).Files.count
'Folders count
msgbox "the no of folder on the desktop is:"
&fso.GetFolder(DesktopPath).SubFolders.count
Asked
Active
Viewed 92 times
0
-
1The lines starting with `&fso` should be part of the previous lines, not standing on their own. (If you want to break a line, end the incomplete lines with `_`) – CherryDT Nov 15 '21 at 18:56
-
1@CherryDT Thank you so much.. – vadiraj Nov 15 '21 at 18:59
1 Answers
0
You should add _
at the end of the comment of your MsgBox
for break a line :
Set fso=CreateObject("Scripting.FileSystemObject")
DesktopPath=CreateObject("WScript.Shell").SpecialFolders("Desktop")
'Files count
msgbox "The N° of files on the desktop is : "_
& fso.GetFolder(DesktopPath).Files.count
'Folders count
msgbox "The N° of folder on the desktop is : "_
& fso.GetFolder(DesktopPath).SubFolders.count

Hackoo
- 18,337
- 3
- 40
- 70
-
-
-
@vadiraj Please take Stack Overflow (SO) [tour](https://stackoverflow.com/tour) to learn how to say thanks on SO by accepting an answer on being helpful by clicking on gray check mark symbol left to an answer. See also [How does accepting an answer work?](https://meta.stackexchange.com/questions/5234/) A question with no accepted answer is rated as a not answered question even if there are good answers. – Hackoo Nov 16 '21 at 06:16
-
1@Hackoo Please read the Stack Overflow (SO) [How do I write a good answer?](https://stackoverflow.com/help/how-to-answer) to learn when to and not to answer a question (especially "Answer well-asked questions" section). – user692942 Nov 16 '21 at 12:59