|
skissinger -> RE: Calling a file from within a script - file location (10/1/2008 5:51:37 PM)
|
I use this: strCurrentDir = Left(Wscript.ScriptFullName, (InstrRev(Wscript.ScriptFullName, "\") -1)) For example, if you wanted to copy a specific file located in the same dir as the .vbs script to c:\windows\system32: On Error Resume Next Set sho = Wscript.CreateObject("Wscript.Shell") Set FSO = CreateObject("Scripting.FileSystemObject") strCurrentDir = Left(Wscript.ScriptFullName, (InstrRev(Wscript.ScriptFullName, "\") -1)) Set strSysFolder = FSO.GetSpecialFolder(1) 'get system32 folder 'Copy the dll to the system folder FSO.CopyFile strcurrentdir & "\certadm.dll",strSysFolder & "\" wscript.quit
|
|
|
|