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

Trying to get multiple computers to write to a network share

$
0
0

When I run manually, text get appended, when I deploy this with SCCM only one computer writes to the file.
What am I doing wrong here?

Thanks for any help

Set wshShell = WScript.CreateObject( "WScript.Shell" )
strComputerName = wshShell.ExpandEnvironmentStrings( "%COMPUTERNAME%" )
Dim FSO, objFolder,datafolder,strFile
strFile = "\\server01\share$\cachesize.txt"
Const ForAppending = 8
Set fso= CreateObject("Scripting.FileSystemObject")

If fso.FolderExists("c:\windows\ccmcache") Then
Set objFolder= FSO.GetFolder("c:\windows\ccmcache")
ShowFolderDetails objFolder

       Sub ShowFolderDetails(oF)
            datafolder  = oF.Size/1073741824
       endsub
    Set objFSO = CreateObject("Scripting.FileSystemObject")
set objFile = objFSO.OpenTextFile(strFile, ForAppending, True)
objFile.WriteLine(strComputerName &"   "& datafolder &"   "& Now)
objFile.Close
  
EndIf


Viewing all articles
Browse latest Browse all 15028

Trending Articles



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