My current work using VBS is lacking but i tried to simplify the best I could. Only problem is from the script the folders won't create
Here is my script:
Explicit
'Declare Variables and constantsDim objShell, objFSO
'Create objectsSet objShell = CreateObject("WScript.Shell")Set objFSO = createobject("scripting.filesystemobject")
'=============================================================================================================================='Main body'==============================================================================================================================On Error Resume Next
'Create the C:\Program Files\bginfo\bginfo folderIf not objFSO.FolderExists("C:\Program Files\bginfo\bginfo") Then objFSO.CreateFolder("C:\Program Files\bginfo\bginfo")End IfIf not objFSO.FolderExists("C:\ProgramData\Microsoft\Windows\Start Menu\Programs\bginfo") Then objFSO.CreateFolder("C:\ProgramData\Microsoft\Windows\Start Menu\Programs\bginfo")End If
'Copy the bginfo filesobjFSO.CopyFile(objShell.CurrentDirectory & "\Bginfo.exe", "C:\Program Files\bginfo\")objFSO.CopyFile(objShell.CurrentDirectory & "\bginfo.bgi", "C:\Program Files\bginfo\")objFSO.CopyFile(objShell.CurrentDirectory & "\IPv4Only.vbs", "C:\Program Files\bginfo\")objFSO.CopyFile(objShell.CurrentDirectory & "\IPv6Only.vbs", "C:\Program Files\bginfo\")
'Copy the Shortcut to Program FilesobjFSO.CopyFile(objShell.CurrentDirectory & "\ PC Info.lnk", "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Bginfo")
So what I am doing wrong that prevents the folders from being created?
Sorry this is simple for a lot of you but confusing for me.
Thanks!