Capture output value from a shell command in VBA?

Based on Andrew Lessard’s answer, here’s a function to run a command and return the output as a string – Public Function ShellRun(sCmd As String) As String ‘Run a shell command, returning the output as a string Dim oShell As Object Set oShell = CreateObject(“WScript.Shell”) ‘run command Dim oExec As Object Dim oOutput As Object … Read more

Bash in Git for Windows: Weirdness when running a command with CMD.exe /C with args

This is actually documented in the ReleaseNotes file (in the top level folder of your installed Git for Windows) Also, extra care has to be paid to pass Windows programs Windows paths, as they have no clue about MSys style POSIX paths — You can use something like $(cmd //c echo “$POSIXPATH”). If you use … Read more

Enable tcp\ip remote connections to sql server express already installed database with code or script(query)

I tested below code with SQL Server 2008 R2 Express and I believe we should have solution for all 6 steps you outlined. Let’s take on them one-by-one: 1 – Enable TCP/IP We can enable TCP/IP protocol with WMI: set wmiComputer = GetObject( _ “winmgmts:” _ & “\\.\root\Microsoft\SqlServer\ComputerManagement10”) set tcpProtocols = wmiComputer.ExecQuery( _ “select * … Read more