Skip to content

Instantly share code, notes, and snippets.

@fornext1119
fornext1119 / gist:2848325
Created June 1, 2012 03:01
VBScriptでフォルダ内のSQLを読んで実行結果をExcelに出力する
Option Explicit
Private fs
Private conn
Private excelApp
Private excelBook
Private excelSheet
'出力シートの準備
Private Sub openSheet(iSheet, sqlFile)
@fornext1119
fornext1119 / gist:2849484
Created June 1, 2012 06:18
VBScriptでフォルダ内のSQLを読んで実行結果をTAB区切りファイルに出力する
Option Explicit
Private fs
Private conn
'結果出力
Private Sub writeResult(rs, sqlFile)
'上書きか、追加書き込みか
Dim mode: mode = "2" '2:ForWriting
If WScript.Arguments.Count > 2 Then
@fornext1119
fornext1119 / gist:2866620
Created June 4, 2012 06:07
WindowsPowerShellでSQLを実行し結果をコンソール出力
[System.Reflection.Assembly]::LoadWithPartialName("System.Data")
$cs = "Provider=MSDAORA;User ID=xxxxx;Password=yyyyy;Data Source=zzzzz"
$oraCon = New-Object System.Data.OleDb.OleDbConnection($cs)
$oraCmd = New-Object System.Data.OleDb.OleDbCommand
$oraCon.Open()
$oraCmd.Connection = $oraCon
$oraCmd.CommandText = "SELECT * FROM wwwwww"
$oraReader = $oraCmd.ExecuteReader()
while ($oraReader.Read())
{
@fornext1119
fornext1119 / gist:2957705
Created June 20, 2012 02:01
VBScript で Internet Explorer を 制御
Option Explicit
'IE起動
Dim ie: Set ie = CreateObject("InternetExplorer.Application")
ie.Visible = True
ie.Toolbar = True
ie.MenuBar = True
ie.AddressBar = True
ie.StatusBar = True
@fornext1119
fornext1119 / gist:2957723
Created June 20, 2012 02:04
Perl で Internet Explorer を 制御
use strict;
use warnings;
use Win32::OLE;
my $ie = Win32::OLE->new('InternetExplorer.Application');
$ie->{Visible} = 1;
$ie->{ToolBar} = 1;
$ie->{MenuBar} = 1;
$ie->{AddressBar} = 1;
@fornext1119
fornext1119 / gist:2957750
Created June 20, 2012 02:07
PHP で Internet Explorer を 制御
<?php
$ie = new COM('InternetExplorer.Application');
$ie->Visible = true;
$ie->ToolBar = true;
$ie->MenuBar = true;
$ie->AddressBar = true;
$ie->StatusBar = true;
#ログオン画面
@fornext1119
fornext1119 / gist:2957761
Created June 20, 2012 02:11
Ruby で Internet Explorer を 制御
require 'win32ole'
ie = WIN32OLE.new('InternetExplorer.Application')
ie.Visible = true
ie.Toolbar = true
ie.MenuBar = true
ie.AddressBar = true
ie.StatusBar = true
#ログオン画面
@fornext1119
fornext1119 / gist:2957763
Created June 20, 2012 02:12
Python で Internet Explorer を 制御
# coding: Shift_JIS
import win32api, win32con, win32com, win32com.client, os, time, sys
ie = win32com.client.Dispatch("InternetExplorer.Application")
ie.Visible = True
ie.ToolBar = True
ie.MenuBar = True
ie.AddressBar = True
ie.StatusBar = True
@fornext1119
fornext1119 / gist:2958331
Created June 20, 2012 05:48
JScript で Internet Explorer を 制御
var ie = WScript.CreateObject("InternetExplorer.Application");
ie.Visible = true;
ie.Toolbar = true;
ie.MenuBar = true;
ie.AddressBar = true;
ie.StatusBar = true;
//ログオン画面
ie.Navigate("http://192.168.1.1/zzzz.asp");
while (ie.Busy || ie.readystate != 4)
@fornext1119
fornext1119 / gist:2958482
Created June 20, 2012 06:48
PowerShell で Internet Explorer を 制御
$ie = New-Object -ComObject internetexplorer.application
$ie.Visible = $true
$ie.Toolbar = $true
$ie.MenuBar = $true
$ie.AddressBar = $true
$ie.StatusBar = $true
#ログオン画面
$ie.Navigate('http://192.168.1.1/zzzz.asp')
while($ie.busy -or $ie.readystate -ne 4)