Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Need help with VBScript Urgent

$
0
0

Hi, I am working on a specific project which requires a file to be updated on all users machine before deployment. I have tried a script which is not working and does not give any error either. Please check this for me urgently as I am running short of time. 

Requirement: Script should force copy a file located on a common file share to a folder in users machine. I am not deploying this script via any GP or SCCM due to certain reason. I will be sending mail to users with a hyperlink which should trigger the script and perform the action. I would be delighted if there is a way if users can get a pop up window stating "Successfully Copied" or some sort. 

Here is my incomplete script.

Set objFso=createObject("scripting.fileSystemObject")

 

set objWShell=wScript.createObject("WScript.Shell")

 

usrName=objWShell.expandEnvironmentStrings("%USERNAME%")

 

strFileToCopy="\\ja-rfzitd\INSTDIR\000 Sephora - UAT\Foundation\test.fcf"

 

strFolder="C:\Users\%USERNAME%\AppData\Roaming\Test\"

 

if objFso.folderExists(strFolder) then

 

objFso.copyFile strFileToCopy,strFolder&"\",true

 

end if


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>