Sideway BICK BlogSideway BICK BLOG from Sideway

A Sideway to Sideway Home

Link:http://output.to/sideway/default.asp?qno=130300028

GetFolder / MoveFolder, FileSystemObject Object, ASP Server Component

FileSystemObject Object

One function of FileSystemObject object is the manipulation of folders of the file system.

FileSystemObject.GetFolder Method

FileSystemObject.GetFolder method is the method to return an instance of a Folder object corresponding to the specified folder specification related to the specified FileSystemObject Object.

Syntax:

FileSystemObjectName.GetFolder(folderspec)

 Or in VBScript. Imply

FolderObjectName = FileSystemObjectName.GetFolder(folderspec)

 Or in JScript. Imply

FolderObjectName = FileSystemObjectName.GetFolder(folderspec)

Parameters:

FolderObjectName

The parameter "FolderObjectName" is the name assigned to the instance of the Folder object returned by the method using the FileSystemObjectName.GetFolder Method.

FileSystemObjectName

The parameter "FileSystemObjectName" is used to specify the name of the instance of the FileSystemObject Object related to.

folderspec

The parameter "folderspec" is used to specify the folder specification for which the Folder object to be returned. The parameter folderspec is the absolute or relative path of the specific folder. Unlike the return of parent folder name, an error occurs if the parameter folderspec of the specified folder does not exist.

Return Values:

Folder object

The method returns an instance of Folder object corresponding to the specified folderspec related to the specified FileSystemObject Object. 

Remarks:

FileSystemObjectName should always refer to a FileSystemObject Object.

Examples:

  • Example of using the GetFolder method to return an instance of Folder object

    ASP VBScript command:

    <script runat="server" language="VBScript">
    Dim fso, FolderObjectName
    Set fso = CreateObject("Scripting.FileSystemObject")
    set FolderObjectName = fso.GetFolder("/temp")
    Response.Write FolderObjectName.Path & "<br />"
    set FolderObjectName = fso.GetFolder("c:/temp")
    Response.Write FolderObjectName.Path & "<br />"
    set FolderObjectName = fso.GetFolder("c:/temp/test")
    Response.Write FolderObjectName.Path & "<br />"
    set FolderObjectName = fso.GetFolder(fso.GetParentFolderName(fso.GetAbsolutePathName("test1")))
    Response.Write FolderObjectName.Path & "<br />"
    </script>

    HTML web page ouput:

    C:\Temp
    C:\Temp
    C:\Temp\test
    C:\Temp

  • Example of using the GetFolder method to return an instance of Folder object

    ASP JScript command:

    <script runat="server" language="JScript">
    var fso, FolderObjectName;
    fso = new ActiveXObject("Scripting.FileSystemObject");
    FolderObjectName = fso.GetFolder("/temp");
    Response.Write(FolderObjectName.Path + "<br />") ;
    FolderObjectName = fso.GetFolder("c://temp");
    Response.Write(FolderObjectName.Path + "<br />") ;
    FolderObjectName = fso.GetFolder("c://temp//test");
    Response.Write(FolderObjectName.Path + "<br />") ;
    FolderObjectName = fso.GetFolder(fso.GetParentFolderName(fso.GetAbsolutePathName("test1")));
    Response.Write(FolderObjectName.Path + "<br />");
    </script>

    HTML web page ouput:

    C:\Temp
    C:\Temp
    C:\Temp\test
    C:\Temp

FileSystemObject.MoveFolder Method

FileSystemObject.MoveFolder method is the method to move one or more folders according to the specified source location from the source location to the destination location related to the specified FileSystemObject Object

Syntax:

FileSystemObjectName.MoveFolder(source, destination)

 Or in VBScript. Imply

FileSystemObjectName.MoveFolder(source, destination)

 Or in JScript. Imply

FileSystemObjectName.MoveFolder(source, destination) 

Parameters:

FileSystemObjectName

The parameter "FileSystemObjectName" is used to specify the name of the instance of the FileSystemObject Object related to.

source

The parameter "source" is used to specify the path string of the source folder specification to be moved from. Wildcard characters can be used to specify one or more folders to be moved. However the wildcard characters can only be used in the last path component of the path specification.

destination

The parameter "destination" is used to specify the path string of the destination folder specification to which the folder and subfolders from source are to be moved. Wildcard characters cannot be used to specify the path of  desitination folder.

Remarks:

FileSystemObjectName Method should always refer to a FileSystemObject Object.

If the parameter source contains wildcard characters or the parameter destination ends with a path separator (\), the parameter destination is assumed to be an existing folder in which to copy matching folders and subfolders. Otherwise, the parameter destination is assumed to be the name of the folder to be created for copying to.

In either case, when moving from the source to the desination,

  • If the destination does not exist, the source folder and all its contents gets moved.

  • If the destination is an existing file, an error occurs.

  • If the destination is a directory, an error occurs.

An error also occurs if a source doesnot match any folders when using wildcard characters.

Besides, the CopyFolder method stops on the first error it encounters. No attempt is made to roll back any changes were made before an error occurs.

This method also allows moving folders between volumes only if supported by the operating system.

Permission Denied Error may occur, if the folder is not shared with the corresponding Web Server.

Examples:

  • Example of using the MoveFolder method to one or more folders from the source to destination.

    ASP VBScript command:

    <script runat="server" language="VBScript">
    Dim fso
    Set fso = CreateObject("Scripting.FileSystemObject")
    fso.MoveFolder "c:\temp1\*" , "c:\temp2" 
    </script>

    HTML web page ouput:

     

  • Example of using the MoveFolder method to one or more folders from the source to destination.

    ASP JScript command::

    <script runat="server" language="JScript">
    var fso, foldero;
    fso = new ActiveXObject("Scripting.FileSystemObject");
    fso.MoveFolder("c:\\temp1\\*", "c:\\temp2");
    </script>

    HTML web page ouput:::

     

Link:http://output.to/sideway/default.asp?qno=130300029

Useful Command Run Shortcut for Windows XP Knowledge Base

Windows XP Knowledge Base

source: http://support.microsoft.com/kb/313808/, http://support.microsoft.com/kb/192806, and http://support.microsoft.com/kb/149648    last updated 3/25/2013 and others

Useful Command Run Shortcut for Windows XP:

In general, the command "control" causes Windows substitutes the name of the tool for %1% to run. For example: "control hotplug.dll" is equivalence to "%windir%\system32\RunDll32.exe shell32.dll,Control_RunDLL hotplug.dll" or "rundll32.exe shell32.dll,Control_RunDLL hotplug.dll". 

  1. "access.cpl" (C:\WINDOWS\system32\access.cpl) to open the Accessibility Options GUI

    Command input and Output GUI

      image image

  2. "appwiz.cpl" (C:\WINDOWS\system32\appwiz.cpl) to open the Add or Remove Programs GUI

    Command input and Output GUI

      image image

  3. "bthprops.cpl" (C:\WINDOWS\system32\bthprops.cpl) to open the Bluetooth Devices GUI

    Command input and Output GUI

      image image

  4. "command" (C:\WINDOWS\system32\command.com) to open the windows dos command prompt GUI

    Command input and Output GUI

      image image

  5. "compmgmt.msc" (C:\WINDOWS\system32\compmgmt.msc) to open the windows Computer Management GUI

    Command input and Output GUI

      image image

  6. "cmd" (C:\WINDOWS\system32\cmd.exe) to open the windows XP command prompt GUI

    Command input and Output GUI

      image image

  7. "desk.cpl" (C:\WINDOWS\system32\desk.cpl)  to open the Display Properties GUI

    Command input and Output GUI

      image image

  8. "devmgmt.msc" (C:\WINDOWS\system32\devmgmt.msc)  to open the Device Manager GUI

    Command input and Output GUI

      image image

  9. "dfrg.msc" (C:\WINDOWS\system32\dfrg.msc)  to open the Disk Defragmenter GUI

    Command input and Output GUI

      image image

  10. "diskmgmt.msc" (C:\WINDOWS\system32\diskmgmt.msc)  to open the Disk Management GUI

    Command input and Output GUI

      image image

  11. "eventvwr.msc" (C:\WINDOWS\system32\eventvwr.msc)  to open the Event Viewer GUI

    Command input and Output GUI

      image image

  12. "control findfast.cpl":  FindFast included with Microsoft Office for Windows 95

  13. "fonts" (fonts)  to open folder of the Fonts GUI

    Command input and Output GUI

      image image

  14. "control fonts" (control fonts)  to open folder of the Fonts GUI

    Command input and Output GUI

      image image

  15. "gpedit.msc" (C:\WINDOWS\system32\gpedit.msc)  to open the Group Policy GUI

    Command input and Output GUI

      image image

  16. "control hotplug.dll" (C:\WINDOWS\system32\hotplug.dll)  to open the Safely Remove Hardware GUI

    Command input and Output GUI

      image image

  17. "inetcpl.cpl" (C:\WINDOWS\system32\inetcpl.cpl)  to open the Internet Properties GUI of Internet Explorer

    Command input and Output GUI

      image image

  18. "intl.cpl" (C:\WINDOWS\system32\intl.cpl)  to open the Regional and Language Options GUI

    Command input and Output GUI

      image image

  19. "Irprops.cpl" (C:\WINDOWS\system32\Irprops.cpl)  to open the Infrared Port properties GUI

    Command input and Output GUI

      image

  20. "joy.cpl" (C:\WINDOWS\system32\joy.cpl)  to open the Game Controllers GUI

    Command input and Output GUI

      image image

  21. "lusrmgr.msc" (C:\WINDOWS\system32\lusrmgr.msc)  to open the Local Users and Groups GUI

    Command input and Output GUI

      image image

  22. "mailto:" protocol to open the default email client

    Command input and Output GUI

      image image

  23. "main.cpl" (C:\WINDOWS\system32\main.cpl)  to open the Mouse Properties GUI

    Command input and Output GUI

      image image

  24. "C:\Program Files\Common Files\System\Mapi\1033\Mlcfg32.cpl" (C:\Program Files\Common Files\System\Mapi\1033\Mlcfg32.cpl where 1033 can be other version)  to open the Mail Setup - Outlook GUI

    Command input and Output GUI

      image image

  25. "mmsys.cpl" (C:\WINDOWS\system32\mmsys.cpl) to open the Sounds and Audio Devices Properties GUI

    Command input and Output GUI

    image image

  26. "control modem.cpl" : Modem properties included in Windows 95

  27. "msconfig" (C:\WINDOWS\ServicePackFiles\i386\msconfig.exe) to open the System Configuration Utility GUI

    Command input and Output GUI

    image image

  28. "msinfo32" (C:\Program Files\Common Files\Microsoft Shared\MSInfo\msinfo32.exe) to open the System Information GUI

    Command input and Output GUI

    image image

  29. "ncpa.cpl" (C:\WINDOWS\system32\ncpa.cpl) to open the Network Connections GUI

    Command input and Output GUI

    image image

  30. "control netcpl.cpl":  Network properties included with Windows 95

  31. "nusrmgr.cpl" (C:\WINDOWS\system32\nusrmgr.cpl) to open the User Accounts GUI

    Command input and Output GUI

    image image

  32. "nwc.cpl" (C:\WINDOWS\system32\nwc.cpl) to open the Gateway Services for NetWare properties GUI

    Command input and Output GUI

    image 

  33. "odbccp32.cpl" (C:\WINDOWS\system32\odbccp32.cpl) to open the ODBC Data Source Administrator GUI

    Command input and Output GUI

    image image

  34. "control password.cpl":  Password properties included with Windows 95

  35. "powercfg.cpl" (C:\WINDOWS\system32\powercfg.cpl) to open the Power Options Properties GUI

    Command input and Output GUI

    image image

  36. "control printers" (rundll32.exe shell32.dll,SHHelpShortcuts_RunDLL PrintersFolder)  to open folder of the Printers and Faxes GUI

    Command input and Output GUIput and Output GUI

      image image

  37. "perfmon.msc" (C:\WINDOWS\system32\perfmon.msc) to open the Performance GUI

    Command input and Output GUI

    image image

  38. "regedit" (C:\WINDOWS\regedit.exe) to open the Registry Editor GUI

    Command input and Output GUI

    image image

  39. "rsop.msc" (C:\WINDOWS\system32\rsop.msc) to open the Resultant Set of Policy GUI

    Command input and Output GUI

    image image

  40. "control sapi.cpl" (C:\Program files\Common files\Microsoft Shared\Speech) to open the Speech properties GUI

    Command input and Output GUI

    image 

  41. "secpol.msc" (C:\WINDOWS\system32\secpol.msc) to open the Local Security Settings GUI

    Command input and Output GUI

    image image

  42. "services.msc" (C:\WINDOWS\system32\services.msc) to open the Services GUI

    Command input and Output GUI

    image image

  43. "sndvol32" (C:\WINDOWS\system32\sndvol32.exe) to open the Master Volume GUI

    Command input and Output GUI

    image image

  44. "control sticpl.cpl":  Scanners and Cameras properties included with Windows 95

  45. "control sticpl.cpl" (control sticpl.cpl) to open folder of Scanners and Cameras GUI

    Command input and Output GUI

    image image

  46. "sysdm.cpl" (C:\WINDOWS\system32\sysdm.cpl) to open the System Properties GUI

    Command input and Output GUI

    image image

  47. "sysedit" (C:\WINDOWS\system32\sysedit.exe) to open the four system files in System Configuration Editor for editing

    Command input and Output GUI

    image image

  48. "telephon.cpl" (C:\WINDOWS\system32\telephon.cpl) to open the Phone and Modem Options GUI

    Command input and Output GUI

    image image

  49. "control themes.cpl":  Desktop Themes included with Windows 95

  50. "timedate.cpl" (C:\WINDOWS\system32\timedate.cpl) to open the Date and Time Properties GUI

    Command input and Output GUI

    image image

  51. "control wgpocpl.cpl":  microsoft mail postoffice included with Windows 95

  52. "winver" (C:\WINDOWS\system32\winver.exe) to open the About Windows GUI

    Command input and Output GUI

    image image

Previous Month  MAR  2013  Next Month
SMTWTFS
12
3456789
10111213141516
17181920212223
24252627282930
31

Previous Month  APR  2013  Next Month
SMTWTFS
123456
78910111213
14151617181920
21222324252627
282930

Sideway BICK Blog

23/03


Copyright © 2000-2020 Sideway . All rights reserved Disclaimerslast modified on 26 January 2013