transfer CurrentDirectory from un-elevated script to elevated one
问题 I need to copy my file "manufacturer.bmp", wich is located in the same directory as the script (in my flash drive), to the system32 directory. I succeed, in getting the variables sourcefile , destinationdirectory , and to elevate my script, but when I elevate it, my sourcefile variable is lost, because of the use of CurrentDirectory , which differs in this mode. Set shell = WScript.CreateObject("WScript.Shell") Set fso = CreateObject("Scripting.FileSystemObject") CurrentDirectory = fso