Loggin Script (2)
Dear All,
I want to move C:\Documents and Settings\username\My Documents to D:\Documents and Settings\username\My Documents (from drive C: to D:). Is it possible to move it from loggin script?
Because I got some loggin script to move folder, but it doesn't work at all. And I really want to create this script only using batch file. I don't how to create loggin script, is it enough by using batch file or should use WMI or VB Scripts.
Could anyone help me? Before and after thankyou very much.
here I attach some loggin script to move folder that I have:
1.
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.MoveFolder "C:\Scripts" , "M:\helpdesk\management"
2.(Using Shell Object)
Const FOF_CREATEPROGRESSDLG = &H0&
TargetFolder = "D:\Archive"
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.NameSpace(TargetFolder)
objFolder.MoveHere "C:\Scripts", FOF_CREATEPROGRESSDLG
3.Using WMI
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:\Admins\Documents\Archive\VBScript")
Wscript.Echo errResults
Next