bigdwhite Posted October 23, 2006 Share Posted October 23, 2006 Hello all. I would first like to say that you all rock. Awesome code, techniques, and camaraderie in here. Nicest forum Ive seen in a while. I have one question. I converted this wscript to .au3 but get an error. Const MY_COMPUTER = &H11& Set objNetwork = CreateObject("Wscript.Network") objComputerName = objNetwork.ComputerName Set objShell = CreateObject("Shell.Application") Set objFolder = objShell.Namespace(MY_COMPUTER) Set objFolderItem = objFolder.Self objFolderItem.Name = objComputerName Converted code: Const $MY_COMPUTER = "&H11&" $objNetwork = ObjCreate("Wscript.Network") $objComputerName = $objNetwork.ComputerName $objShell = ObjCreate("Shell.Application") $objFolder = $objShell.Namespace($MY_COMPUTER) $objFolderItem = $objFolder.Self ; <-------------------------- Error here $objFolderItem.Name = $objComputerName The requested action with this object has failed.: $objFolderItem = $objFolder.Self $objFolderItem = $objFolder.Self^ ERROR I've researched but found no help. lack of time requires me to break down and ask. i'm still learning about objects. So much to learn. I'm thinking of buying a book. Any direction or tips would be greatly appreciated. This part assumes you care. I myself stopped coding 15 years ago to consult but recently contracted with a company to develop automated procedures for setting up remote computers for the purpose of remote service and maintenance. Its great to install software, hack the reg, and dig into windows with the ease of AutoIt. And honestly, I couldnt have done it without this forum (kept me from buying a book or two or learning VB all over again). So thank you all. My girlfriend sitting here wants to know if you feel the breeze? Upon my inquiry, her response was: ..you blowing smoke up their asses? LOL Such class! Link to comment Share on other sites More sharing options...
bigdwhite Posted October 24, 2006 Author Share Posted October 24, 2006 Awesome. Thank you very much!!do you have or know of a site that could have answered that. a suggested book maybe? to start$MY_COMPUTER = 0x11 Link to comment Share on other sites More sharing options...
bigdwhite Posted October 31, 2006 Author Share Posted October 31, 2006 Hey Larry, Thnx for all your help. Is there a better way to do this? i'm sure you know where the error is. and yes, i'm using AConverter.au3 to get this. :"> Thx in advance. $HKEY_CURRENT_USER = &H80000001 $strComputer = @ComputerName $objReg = ObjGet("winmgmts:\\" & $strComputer & "\root\default:StdRegProv") $strKeyPath = "SOFTWARE\Microsoft\Internet Explorer\Main" $objReg.CreateKey ($HKEY_CURRENT_USER, $strKeyPath) $ValueName = "Start Page" $strValue = "about:blank" $objReg.SetStringValue ($HKEY_CURRENT_USER, $strKeyPath, $ValueName, $strValue) Hello all. Link to comment Share on other sites More sharing options...
thefluxster Posted November 1, 2006 Share Posted November 1, 2006 I've seen someone post information about error handling with COM objects but have since lost that information (oh the things I should have written down.. :"> ) Anyone know where it is? Perhaps a search pattern or two that would help unearth the beast? “Efficiency is doing things right; effectiveness is doing the right things.”-Peter F. Drucker Link to comment Share on other sites More sharing options...
GaryFrost Posted November 1, 2006 Share Posted November 1, 2006 To begin with: $HKEY_CURRENT_USER = 0x80000001 SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
MHz Posted November 1, 2006 Share Posted November 1, 2006 Take a look at the ObjEvent page in the helpfile for handling COM errors. ObjEvent ( "AutoIt.Error" [, "function name"])Especially the example that shows a function acting as the error handlier being called. Link to comment Share on other sites More sharing options...
bigdwhite Posted November 1, 2006 Author Share Posted November 1, 2006 thanks guys. sarcasm and all. thats the info i've been looking for. now that you've pointd me in the right direction, i won't have bother you with trivial request. right thephuxster ? oh sorry, no spell check here. ) Link to comment Share on other sites More sharing options...
bigdwhite Posted November 1, 2006 Author Share Posted November 1, 2006 actually, the search engine here sucks. but whos complaining!I've seen someone post information about error handling with COM objects but have since lost that information (oh the things I should have written down.. :"> )Anyone know where it is? Perhaps a search pattern or two that would help unearth the beast? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now