RE: VBScript root folder property question



Please disregard this mssg, I just realized I had to designate the root as
'drive letter + :' and not 'drive letter + :\'

That got it working!

___________________________________________________________________

"Vgolfmaster" wrote:

Hi again,

I now have a script which needs to access the root folder of a user defined
drive in order to test for the existance of sub folders. I am having no luck
getting access to the root folder of the selected drive. Is the 'getfolder'
method the wrong thing to be using for this? The script looks like this:

Option Explicit

'Declare Variables
Dim WshShl, iconyn, dtop, scut, dltr, argobj, fso, dready
Dim path, fold, subf

'Get User Input For Desktop Icon Creation

set WshShl = WScript.CreateObject("WScript.Shell")

iconyn = WshShl.Popup("Would you like a shortcut for this script"_
& " created on your desktop?",,"User Input",36)

'Process User Selection and Create Icon If Requested

If iconyn = 6 Then
dtop = WshShl.SpecialFolders("Desktop")
set scut = WshShl.CreateShortcut(dtop & "\Assignment6.lnk")
scut.TargetPath = "c:\assignment6.vbs"
scut.IconLocation = "c:\disk.ico"
scut.Save
End if

'Get user input for Drive letter selection
'31
dltr = InputBox("Please enter a drive letter")

'Check for existance of drive and if it is ready

Set fso = WScript.CreateObject("Scripting.filesystemobject")
If Not fso.DriveExists(dltr) Then
Wscript.Echo "That Drive does not Exist"
Wscript.Quit
End If
Set dready = fso.GetDrive(dltr)
If Not (dready.IsReady) Then
Wscript.Echo "That Drive Is Not Ready"
Wscript.Quit
End If

'Check root of selected drive for existance of sub folders

<b>set fold = fso.GetFolder(dltr)
set subf = fold.subfolders
If subf.count =0 Then
Wscript.echo "The Selected Drive Contains No Sub-Folders"
Wscript.Quit
End If
Wscript.Wcho "The Drive Contains Sub Folders!"</b>


.



Relevant Pages

  • IBM Informix Web DataBlade: Local root by design
    ... IBM Informix Web DataBlade: Local root by design ... Impact: Any user who can: 1) Save a Perl script anywhere on the server's ... admin right on any database can do it by loading the WDB module into ...
    (Bugtraq)
  • RE: Linux hacked
    ... I would also suggest using a simple script in the future that alerts ... Subject: Linux hacked ... To get back into your account you want to use, at the boot manager ... boot normally and you should be able to login as root with your new ...
    (Security-Basics)
  • Re: BSDstats v3.0 - The Security Rewrite
    ... The bsdstats script could easily pick up that entry and set ... a management machine, and that management machine only has ... Email is sent to root containing IDTOKEN= as generated by host, root forwards that to rpt@xxxxxxxxxxxx, rpt@xxxxxxxxxxxx sends back KEY= value ... second time, submits report values to root, root forwards that to rpt@xxxxxxxxxxxx ... ...
    (freebsd-questions)
  • Re: Great SWT Program
    ... from a terminal emulator and log in as root there. ... terminal-emulator windows open, ... The script, suid-root utility, or whatever would ... the command interpreter with root privileges ...
    (comp.lang.java.programmer)
  • Re: Rexx problem? - advice sought, Please
    ... Examples (Start with Drive S: current is root): ... In REXX function Directory() gets the same result as CD. ... There have been several public betas of this application using the install script. ...
    (comp.os.os2.programmer.misc)