Emnico in Swindon and its partners
in the UK and Europe provide:

» IT Support Services and Products
» Bespoke Software Development


Contact our Swindon office on:
+44 (0)1793 614 700
to discuss your IT needs.


CLOSE IT
Emnico Logo
Your Virtual Technology Team
Delivering Peak Performance
Category: Type: Order:
Search For:  
Home > Library > Rename a Folder

Rename a Folder

This simple example script renames the C:\scripts directory to C:\repository.
Added 284 days ago by Emnico
Download
Review
Back
58Views
This script has been successfully tested by Emnico and is verified to be working.

Source code

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colFolders = objWMIService.ExecQuery _
    ("Select * from Win32_Directory where name = 'c:\\scripts'")

For Each objFolder in colFolders
    errResults = objFolder.Rename("C:\repository")
Next


| Privacy policy | Environmental policy | Site map |