Login | |
|
 |
Folder Creation Within Windows XP - 9/11/2006 9:45:46 PM
|
|
 |
|
| |
beardedbob
Posts: 4
Score: 0
Joined: 9/11/2006
Status: offline
|
Hi I'm trying to write a VB Script that creates 3 folders from 3 different user inputs, e.g top level folder, then a sub to that then another sub so 3 levels deep. example:- C:\Dealer\ Client\ Location Then the end result will be another set of folders adding 2 more lower levels to what has been created already. Where i'm getting stuck is that with the code i've written so far shows this error, I've not added the lower part yet as im trying to get it to just do this but it is a requirement. “C:\Documents and Settings\UserName\Desktop\Creation.vbs(53, 1) Microsoft VBScript runtime error: Object required: 'objFolder'” The app has to be run by the end user and has to be kept simple and not require aything else bar the .vbs stored locally. I've pasted the code, if someone could help me that would be create, until i'll keep trying. Thanks for your time in advance ‘’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’ Set fso = Wscript.CreateObject("Scripting.FileSystemObject") '''''''''''''''''''''''''''''''''''''''''''''''''''''''' Dim Input Dim Input1 Dim Input2 Dim InstallPath Dim SecIn Dim ThirdIn ''''''''''''''''''''''''''''''''''''''''''''''''''''' Input = InputBox("Enter Dealer Name:", "Data Entry") If IsEmpty(Input) Then MsgBox "No data entered", vbExclamation, "Cancel Pressed" End If Input1 = InputBox("Enter Client Name:", "Data Entry") Input2 = InputBox("Enter Location Name:", "Data Entry") ''''''''''''''''''''''''''''''''''''''''''''''''''''' InstallPath = "C:\" SecIn = InstallPath & Input ThirdIn = SecIn & Input1 '''''''''''''''''''''''''''''''''''''''''''''''''''''' ParentFolder = InstallPath set objShell = CreateObject("Shell.Application") set objFolder = objShell.NameSpace(ParentFolder) If Not fso.FolderExists(InstallPath + Input) Then objFolder.NewFolder "" & Input Else MsgBox "This Project Name Has Already Been Used, Please Use Another" WScript.quit(1) End If ParentFolder = SecIn Set objShell = CreateObject("Shell.Application") Set objFolder = objShell.NameSpace(ParentFolder) objFolder.NewFolder "" & Input1 ParentFolder = ThirdIn Set objShell = CreateObject("Shell.Application") Set objFolder = objShell.NameSpace(ParentFolder) objFolder.NewFolder "" & Input2 .
|
|
| |
|
|
|
 |
RE: Folder Creation Within Windows XP - 9/11/2006 10:46:29 PM
|
|
 |
|
| |
mbouchard
Posts: 1924
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
|
it is trying to get the parentfolder of thirdin but it is only finding C:\test3test1. You are forgetting a \ between second and input1. ThirdIn = SecIn & "\" & Input1
_____________________________
Mike For useful Scripting links see the Read Me First stickey! Always remember Search is your friend.
|
|
| |
|
|
|
 |
RE: Folder Creation Within Windows XP - 9/12/2006 4:00:55 AM
|
|
 |
|
| |
DiGiTAL.SkReAM
Posts: 1194
Score: 7
Joined: 9/6/2005
From: Florida, USA
Status: offline
|
http://www.visualbasicscript.com/m_37662/tm.htm This might help.
_____________________________
"Would you like to touch my monkey?" - Dieter (Mike Meyers) "It is better to die like a tiger, than to live like a pussy." -Master Wong, from Balls of Fury
|
|
| |
|
|
|
|
|