Friday 20 June 2008

update local website with live info

problem: customers stock system doesnt play nice with web, so stock levels and prices are manually updated each morning. local copy of website on sales laptops information can be out by two weeks!

what im not doing: calling in sales reps every day to get up-to-date info


so, vbs to the rescue again. as this is a text file, read into an array by php live it is uploaded using ftp binary type to preserve carriage returns. downloading via ascii should preserve this file characteristic.

on error resume next
url = "onlinepathhere"
path = "localpathhere"
Set xmlhttp = CreateObject("Microsoft.XMLHTTP")
xmlhttp.open "GET", url, False
xmlhttp.send()
if xmlhttp.Status = 200 then 'if status is anything other than 200 it is not ready
Set fstemp = CreateObject("Scripting.FileSystemObject")
fstemp.GetFile(path + "pricelist.bak").Delete 'on error statement ensure script carries on if file doesnt exist
fstemp.MoveFile path + "pricelist.dat", path + "pricelist.bak"
Set filetemp = fstemp.CreateTextFile(path + "pricelist", true)
filetemp.write (xmlhttp.responseText)
filetemp.close
else
msgbox "please ensure that you are connected to the internet to update stock figures" + vbcrlf + vbcrlf + "if you are connected please try again later"
end if
wscript.quit()

Wednesday 18 June 2008

winxp wmi / wbem problems (for no good reason!)

problem: tasklist wont run (dialogue framedyn.dll not found) and the following error in event viewer

The Windows Security Center Service was unable to establish event queries with WMI to monitor third party AntiVirus and Firewall.

what im not doing: an 'inplace reinstall' [edit: i maybe am!]



step 1 - copy framedyn.dll from %windir%\system32\dllcache to %windir%\system32\wbem (as admin)... tasklist runs, but logging out & back in takes us back to problem!

step 2 - run rundll32 wbemupgd, UpgradeRepository to diagnose and repair wmi... wbemupdg module not found... no good!

step 3 - run rundll32.exe setupapi,InstallHinfSection WBEM 132 %windir%\inf\wbemoc.inf, insert winxppro cd then restart... now i have additional warnings along with initial problem!

A provider, HiPerfCooker_v1, has been registered in the WMI namespace, Root\WMI, to use the LocalSystem account. This account is privileged and the provider may cause a security violation if it does not correctly impersonate user requests.

A provider, CmdTriggerConsumer, has been registered in the WMI namespace, Root\cimv2, to use the LocalSystem account. This account is privileged and the provider may cause a security violation if it does not correctly impersonate user requests.

A provider, Rsop Planning Mode Provider, has been registered in the WMI namespace, root\RSOP, but did not specify the HostingModel property. This provider will be run using the LocalSystem account. This account is privileged and the provider may cause a security violation if it does not correctly impersonate user requests. Ensure that provider has been reviewed for security behavior and update the HostingModel property of the provider registration to an account with the least privileges possible for the required functionality.

may have to come back to this one...

Friday 6 June 2008

remote remote desktop

problem: forgot to enable rdp on domain workstation

what im not doing: driving all the way there to tick a box!


easy, connect to remote registry, navigate to

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server

change

fDenyTSConnections

to

0