Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > microsoft.public.scripting.vbscript > #11162

Re: VB script question

Newsgroups microsoft.public.scripting.vbscript
Date 2015-10-29 10:23 -0700
References <ea803277-4f6e-48f0-ab87-9faba81c7e25@googlegroups.com>
Message-ID <dfd11c00-ed36-466c-8e15-da2326f0c865@googlegroups.com> (permalink)
Subject Re: VB script question
From sthakker15@gmail.com

Show all headers | View raw


On Wednesday, October 28, 2015 at 1:21:54 PM UTC-5, sthak...@gmail.com wrote:
> Hello I have 3 different vb Scripts that I like to put it in one.
> And the script should be run only if the folder or file not present. Scripts should run so people can not see any error messages. Trying to avoid phone calls to help desk.Is it possible to make a one script out of all three if yes can I get an example of the script. I have Windows 7 machines in my organization.
> 
> Script 1 Creates folder (Because root folder exist but not the entire path)
> ========================================
> Option Explicit
> 
> Dim shl
> Set shl = CreateObject("WScript.Shell")
> Call shl.Run("%COMSPEC% /c mkdir ""%APPDATA%\Microsoft\Document Building Blocks\1033\15""",0,true)
> =================================================
> 
> Script 2
> ==================================================
> Set objFSO = CreateObject("Scripting.FileSystemObject")
> set objWShell = wScript.createObject("WScript.Shell")
> 
> usrName = objWShell.expandEnvironmentStrings("%USERNAME%")
> 
> objFSO.CopyFile "\\192.168.80.19\public\building blocks.dotx " , "C:\Users\" & usrName & "\appdata\Roaming\Microsoft\Document Building Blocks\1033\", True
> =======================================================
> 
> Script 3
> ===============================================
> Set objFSO = CreateObject("Scripting.FileSystemObject")
> set objWShell = wScript.createObject("WScript.Shell")
> 
> usrName = objWShell.expandEnvironmentStrings("%USERNAME%")
> 
> objFSO.CopyFile "\\192.168.80.19\public\building blocks.dotx " , "C:\Users\" & usrName & "\appdata\Roaming\Microsoft\Document Building Blocks\1033\15\", True
> ==============================================================================
> 
> 
> All three scripts work from the same User Login script group policy. But like to enhance it little but by making it one script.

Thank you very much for your help. Sorry if I asked a question in a wrong group. I thought this one is proper for vbscripts.

Back to microsoft.public.scripting.vbscript | Previous | NextPrevious in thread | Find similar


Thread

VB script question sthakker15@gmail.com - 2015-10-28 11:21 -0700
  Re: VB script question JJ <jj4public@vfemail.net> - 2015-10-29 19:13 +0700
    Re: VB script question Todd Vargo <tlvargo@sbcglobal.netz> - 2015-10-31 12:52 -0400
  Re: VB script question sthakker15@gmail.com - 2015-10-29 10:23 -0700

csiph-web