Page 2 of 2

Re: search and copy a folder using vbscript

Posted: Thu Aug 15, 2013 1:28 pm
by totalyscrewedup
Never mind. Found the solution by running following prior the wshShell:
Dim OSList, OS, UAC
UAC = False
If WScript.Arguments.Count >= 1 Then
If WScript.Arguments.Item(0) = "elevated" Then UAC = True
End If

If Not(UAC) Then
Set OSList = GetObject("winmgmts:").InstancesOf("Win32_OperatingSystem")
For Each OS In OSList
If InStr(1, OS.Caption, "XP") = 0 Then
CreateObject("Shell.Application").ShellExecute "wscript.exe", """" & WScript.ScriptFullName & """ elevated" , "", "runas", 1
WScript.Quit
End If
Next
End If

Re: search and copy a folder using vbscript

Posted: Thu Aug 15, 2013 11:48 pm
by Alexander Riedel
Just wanted to point out that all the things I showed you are free :-)