skissinger
Posts: 2114
Score: 134 Joined: 9/13/2001 From: Sherry Kissinger Status: offline
|
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
_____________________________
mofmaster@smsexpert.com (version 2007) | http://www.smsexpert.com | http://www.sccmexpert.com My Blog Microsoft MVP - ConfigMgr
|