- For individual users
- Instant access to solutions
- Ask your tech questions
- Start your 30-day Free Trial
Main Topics
Browse All TopicsHi guys please can you help me out here, I have a script that copies a file to the pc's system32 directory but I am having difficulty, I would like to set the %netlogon% as the source folder.
at the moment is errors saying "source folder not found" however I replace the source folder with a UNC server name and path it all works fine. I am in a desperate hurry for this so I have put 500 points on it, I would put 10,000 if I could thanks in advanced !!!
'=========================
dim strSource, strDestination
strSource = "\\wfflongham01\netlogon\l
strDestination = "c:\windows\system32\logo\
'=========================
SynchroniseFiles strSource, strDestination
function SynchroniseFiles(byval strSourceFolder, byval strDestinationFolder)
CheckForBackSlash strSourceFolder
CheckForBackSlash strDestinationFolder
dim objFSO
set objFSO = Createobject("scripting.fi
if not objFSO.folderexists(strDes
objFSO.createfolder(strDes
end if
dim file
for each file in objFSO.getfolder(strSource
if not objFSO.fileexists(strDesti
objFSO.copyfile file, strDestinationFolder & file.name
else
if file.DateLastModified > objFSO.getfile(strDestinat
objFSO.copyfile file, strDestinationFolder & file.name
end if
end if
next
set objFSO = nothing
end function
function CheckForBackSlash(byref strFolder)
if right(strFolder, 1) <> "\" then
strFolder = strFolder & "\"
end if
end function
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: TheMCSEPosted on 2005-04-28 at 21:25:27ID: 13892050
I suspect that the problem you were having is with the expansion of the %LOGONSERVER% environment variable. If you were to use something like this:
ipt.Shell" ) entStrings ("%LOGONSE RVER%\netl ogon\logo\ ")
Set objWSHShell = WScript.CreateObject("WScr
strSource = objWSHShell.ExpandEnvironm
You would probably be able to overcome this. Good luck!