Improve this question. Fabien Fabien 6, 7 7 gold badges 32 32 silver badges 34 34 bronze badges. Add a comment. Active Oldest Votes. CreateObject "Scripting. GetSpecialFolder 2 It took me a while to find it on Google. So for the next one looking for the same as me Improve this answer. GetSpecialFolder TemporaryFolder. Fabien's answer was correct as is this one, however, good documentation makes it easier for someone else to read.
Another possibility: CreateObject "WScript. Fionnuala Fionnuala Thanks, Patrick, I missed pasting a line, but that is better. No problem. I was just about to paste my own, almost identical answer, when I saw you beat me by a second I like this one best because it's just as easy to use as GetSpecialFolder , but much less obscure. Makaveli84 Makaveli84 5 5 silver badges 16 16 bronze badges.
You can describe more detail. Improve this answer. Chronocidal Chronocidal 6, 1 1 gold badge 10 10 silver badges 25 25 bronze badges. How exactly does your modified attempt "not work"? Does it still give you an error? A different one? Please edit your question. Close error in line no: 3 object required.
Show 4 more comments. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Active 7 years, 2 months ago. Viewed 7k times. I am tring to get program files folder in vbs. CreateObject "Scripting. What is the correct way to do it? Matt Should be tagged vbscript only. Add a comment. Active Oldest Votes. Shell" msgbox wsc. SpecialFolders "Awesome" So instead you have at least 2 options.
Self msgbox objFolderItem. Matt Matt It's OK to include alternatives that were already suggested by someone else particularly when they were only provided as a comment , as long as there is proper attribution.
0コメント