﻿'Hardware_Info.vbs v1.1 BY: fastslz    http://bbs.bathome.net
On Error Resume Next
'Dim StdOut : Set StdOut = CreateObject("Scripting.FileSystemObject").GetStandardStream(1)
'WScript.Echo "Hello"
'WScript.StdOut.Write "Hello"
'WScript.StdOut.WriteLine "Hello"
'Stdout.WriteLine "Hello"
'Stdout.Write "Hello"

Dim WshShell, strCurDir
Set WshShell = CreateObject("WScript.Shell")
strCurDir    = WshShell.CurrentDirectory
'WshShell.Run strCurDir & "\attribute.exe", 0
Set WshShell = Nothing


Dim lang: lang=GetLocale()

'MsgBox "[" & lang & "]"

' Determine script location for VBScript
Dim oFSO : Set oFSO = CreateObject("Scripting.FileSystemObject")
Dim sScriptDir : sScriptDir = oFSO.GetParentFolderName(WScript.ScriptFullName)

make_batch(strCurDir)

Function make_batch( strDir )
    Const FOR_READING = 1
    Const FOR_WRITING = 2
    Const FOR_APPENDING = 8
    Set Fso = CreateObject("Scripting.FileSystemObject")
    'If  not Fso.FolderExists("C:\netinst") Then
	'	Fso.CreateFolder("C:\netinst")
    'End If

    sys_arch=GetOSBit() 

     If sys_arch = "x86" Then
        pkg_arch="32"
    Else
        pkg_arch="64"
    End If
	Dim remoteDirTools :remoteDirTools="\\NAS-27-59-FD\save_tmp\tools\"
	call CopyFile(remoteDirTools  , "phantomjs.exe")

	
End Function
Function CopyFile( strDir, file)
	On Error Resume Next
    	Call oFSO.CopyFile ( strDir &  "\"  &  file, sScriptDir &  "\"  &  file,  False)
	copy_file=True
End Function


function GetOSBit()
    Dim WshShell
    Dim WshProcEnv
    Dim system_architecture
    Dim process_architecture

    Set WshShell =  CreateObject("WScript.Shell")
    Set WshProcEnv = WshShell.Environment("Process")

    process_architecture= WshProcEnv("PROCESSOR_ARCHITECTURE") 

    If process_architecture = "x86" Then    
        system_architecture= WshProcEnv("PROCESSOR_ARCHITEW6432")

        If system_architecture = ""  Then    
            system_architecture = "x86"
        End if    
    Else    
        system_architecture = process_architecture    
    End If
    GetOSBit = system_architecture
end Function     'GetOSBit





