Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Vbs Object required: '' (error on Line 5)(letter 1)

06 Dec 2014   #1
marthijn99

Windows 8.1 x64
 
 
Vbs Object required: '' (error on Line 5)(letter 1)

as it says in the title

Option Explicit
dim custFolder, folder

custFolder=InputBox("Type custom path")
Folder.CreateFolder "C:\" & custFolder & "folder1"


My System SpecsSystem Spec
.
06 Dec 2014   #2
Alejandro85

Windows 7 Ultimate x64
 
 

In line 5 it says
Code:
Folder.CreateFolder "C:\" & custFolder & "folder1"
It uses a method on the Folder variable but problem is that it was declared (on line 2) but never initialized to anything, hence the error.

What is lacking is creating the "file system object" before using it:
Code:
Set folder=CreateObject("Scripting.FileSystemObject")
My System SpecsSystem Spec
06 Dec 2014   #3
marthijn99

Windows 8.1 x64
 
 

Quote   Quote: Originally Posted by Alejandro85 View Post
In line 5 it says
Code:
Folder.CreateFolder "C:\" & custFolder & "folder1"
It uses a method on the Folder variable but problem is that it was declared (on line 2) but never initialized to anything, hence the error.

What is lacking is creating the "file system object" before using it:
Code:
Set folder=CreateObject("Scripting.FileSystemObject")
thanks that did the trick
My System SpecsSystem Spec
.

Reply

 Vbs Object required: '' (error on Line 5)(letter 1)




Thread Tools Search this Thread
Search this Thread:

Advanced Search




Similar help and support threads
Thread Forum
Object reference not set to an instance of an object
Please help me Object reference not set to an instance of an object. at Tube_Detonator.Main.Updated() at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme) at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
General Discussion
CMD line BCDEDIT to point to winre.wim and Disk letter assignment
Now, i have already 'solved' this issue by installing a temporary copy of Win 7 to the c:\ and using EasyBCD to add an entry to the bcd file, to point to winre.wim to run the HP Recovery factory software. But I should be able to create the bootmgr file just with the command line bcdedit command...
Installation & Setup
BSOD Critical Object Termination, Error 0XF4
I hope someone can help me with this issue. I have an Asus G74S which I have sent back twice due to BSOD issues. The first time Asus replaced a memory stick and the system board. The second time they replaced the CPU. I'm still getting BSOD errors. oh, and fun fact: This laptop is a replacement...
BSOD Help and Support
Object error
Hi all This window started poping up last week. I have search for a fix and followed all the links that say Flash is corrupt, or java is corrupt etc and nothing make it stop. It pops up a few seconds after I open my home page then randomly as the page sits open. I'm running Windows 7 64 bit and I...
Browsers & Mail
Display Player Error: Object expected, Script Error
I am trying to run a certain program and it worked previously for a few days, and then today all of the sudden its giving me this error. Is this a windows thing I can try and fix? Or is it program specific (this program doesnt have much support unfortunately)
Software
Run-time error 429 ActiveX component can't create object
Hi I get the above error every time on startup since installing some software. I have uninstalled the software but still get the error! I tried system restore but it failed for an unspecified reason, please help!
General Discussion


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 07:42.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App