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


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

Re: VB script question

X-Received by 10.129.108.212 with SMTP id h203mr2290796ywc.38.1446139414597; Thu, 29 Oct 2015 10:23:34 -0700 (PDT)
X-Received by 10.140.27.135 with SMTP id 7mr72148qgx.20.1446139414569; Thu, 29 Oct 2015 10:23:34 -0700 (PDT)
Path csiph.com!xmission!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!c107no3203342qgd.1!news-out.google.com!t36ni33353qge.1!nntp.google.com!c107no3203339qgd.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups microsoft.public.scripting.vbscript
Date Thu, 29 Oct 2015 10:23:34 -0700 (PDT)
In-Reply-To <ea803277-4f6e-48f0-ab87-9faba81c7e25@googlegroups.com>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=207.238.105.178; posting-account=Jp32HQoAAACVli8x7sB1LCpe_WWgMj7K
NNTP-Posting-Host 207.238.105.178
References <ea803277-4f6e-48f0-ab87-9faba81c7e25@googlegroups.com>
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <dfd11c00-ed36-466c-8e15-da2326f0c865@googlegroups.com> (permalink)
Subject Re: VB script question
From sthakker15@gmail.com
Injection-Date Thu, 29 Oct 2015 17:23:34 +0000
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding quoted-printable
X-Received-Bytes 3961
X-Received-Body-CRC 1533839935
Xref csiph.com microsoft.public.scripting.vbscript:11162

Show key headers only | 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