wordpress automatic update problem in windows server

error message: Download failed.: Could not create Temporary file

the issue is your wordpress working directory permission related. if you’re using IIS server, make sure to grant “network” this user “RWX” permissions and propagated to all sub directories. that should fix it.

Posted in network | Tagged | Leave a comment

Count rows in excel vb


we want to count number of rows in excel with VB


I create the sub function to count the number of rows depend on where do you want to start!

Sub countRows()
RowCount = 0
RowNext = 22  ( please change the starting row according to your need)
Do While Cells(RowNext, 3).Value <> 0 ( the “3″ also need to be changed)
RowCount = RowCount + 1
RowNext = RowNext + 1
‘MsgBox RowCount
End Sub
Posted in vb | Tagged , , , | Leave a comment

File in use Vb

just found nice code in internet, and i use it in one of my project. works great!
it will return the last user that open the file

Function LastUser(strPath As String) As String

‘// Code by Helen from http://www.xtremevbtalk.com/index.php?s=

‘// This routine gets the Username of the File In Use

‘// Credit goes to Helen for code & Mike for the idea

‘// Amendment 25th June 2004

‘// : Name changes will show old setting

‘// : you need to get the Len of the Name store just before

‘// : the double Padded nullstrings

Dim text As String

Dim strFlag1 As String, strflag2 As String

Dim i As Integer, j As Integer

Dim hdlFile As Long

Dim lNameLen As Byte

strFlag1 = Chr(0) & Chr(0)

strflag2 = Chr(32) & Chr(32)

hdlFile = FreeFile

Open strPath For Binary As #hdlFile

text = Space(LOF(hdlFile))

Get 1, , text

Close #hdlFile

j = InStr(1, text, strflag2)

i = InStrRev(text, strFlag1, j) + Len(strFlag1)

lNameLen = Asc(Mid(text, i – 3, 1))

LastUser = Mid(text, i, lNameLen)

End Function

Posted in vb | Tagged , , | Leave a comment

uploading the latest file to ftp with batch command

uploading the latest file to ftp, all you need 2 .bat files


@echo off

echo user USERNAME> ftpcmd.dat

echo PASSWORD>> ftpcmd.dat

echo bin>> ftpcmd.dat

echo cd REMOTEPATH >> ftpcmd.dat

echo put %1>> ftpcmd.dat

echo quit>> ftpcmd.dat

ftp -n -s:ftpcmd.dat FTPADDRESS

del ftpcmd.dat


@echo off


:source directory


set lastmod=

pushd “%srcDir%”

for /f “tokens=*” %%a in (‘dir /b /od 2^>NUL’) do set lastmod=%%a

if “%lastmod%”==”" echo Could not locate files.&goto :eof


call YOURPATH\fileup.bat “%lastmod%”


del “%lastmod%”

You call the CALL.bat, and the fileup.bat is for information

Posted in batch command | Tagged , , , , | Leave a comment

Transfer to FTP using batch command

there are 2 file you need

1. info of your ftp ( store it in .txt)
in my case i named it info.txt with these code written:

cd yourremotedirectory

2. .bat file to connect to ftp and do what you want
in .bat file simply call the info.txt with this code:

ftp -s:log.txt YourFTPAddress


Posted in batch command | Tagged , , , , | Leave a comment