Re: How to communicate with a batch file

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Fosco (fake_at_fake.invalid)
Date: 05/09/04


Date: Sun, 09 May 2004 13:04:41 GMT


"Bob Altman"

Set oShell = WScript.CreateObject("WScript.Shell")
X =oShell.RegRead("HKLM\Software\Microsoft\"&_
"Windows\CurrentVersion\ProgramFilesDir")

'X is your stuff
' example :
Msgbox X
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.CreateTextFile("c:\test.bat", True)
f.WriteLine"Start "& X

--
Fosco
http://www.allmyfaqs.com/faq.pl?How_to_post
http://learn.to/edit_messages


Relevant Pages

  • Re: Need help capturing DOS output from WSH
    ... so it can be used within WSH for manipulation. ... Set fso = CreateObject ... Set oShell = CreateObject ... Msgbox oShell.CurrentDirectory ...
    (microsoft.public.scripting.wsh)
  • Re: Find Empty Folders
    ... Set fso = CreateObject ... Set oShell = CreateObject ... empty folders, ... Dim oShell, oFolder, oFolderItem, fso, selected, howbad, ColonPos ...
    (microsoft.public.scripting.vbscript)
  • RE: Get file reference using File System Object
    ... Dim FSO As Scripting.FileSystemObject ... Dim FileItem As Scripting.File ... Set FSO = New Scripting.FileSystemObject ... MsgBox ...
    (microsoft.public.excel.programming)
  • Re: FileSystemObject
    ... Msgbox Err.Description ... > On Error Goto Err ... > Set fso = new FileSystemObject ...
    (microsoft.public.vb.com)
  • Re: SaveAS PDF Differences
    ... reference to microsoft scripting runtime) ... Dim fso As object ... set fso = createobject ... msgbox "I'm going to overwrite this file." ...
    (comp.cad.solidworks)