AutoHotkey Community

It is currently May 27th, 2012, 10:16 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: a mass homepage script
PostPosted: May 24th, 2007, 3:42 pm 
Offline

Joined: May 24th, 2007, 3:36 pm
Posts: 9
my science teacher is asking me if their is anyway I would be able to change all of the computers on the schools system's homepage to "www.goodsearch.com" from his laptop.
I want to know if it would be possible to change the homepage of every computer on the one connection using this program?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 24th, 2007, 3:48 pm 
I suppose you mean "for Internet Explorer"?...

Perhaps there is a way with RegWrite:
AHK's Manual wrote:
To access a remote registry, prepend the computer name and a colon, as in this example: \\workstation01:HKEY_LOCAL_MACHINE

Of course, the computer running the script must have the correct rights...


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 24th, 2007, 3:51 pm 
Offline

Joined: May 24th, 2007, 3:36 pm
Posts: 9
yeah thanks I got the rights part figured out


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 25th, 2007, 2:34 am 
Offline

Joined: May 24th, 2007, 3:36 pm
Posts: 9
I think I fail... where did I mess up? I'm testing it with my home computers everything after the regread line works and only works on my computer it won't send the file over and change the homepage I feal like I made some major mess up :? (btw this is the first time I ever tried scripting and it is for internet explorer)
Code:
#space::
RegWrite, REG_SZ, nolan:HKEY_LOCAL_MACHINE, Run, http://www.yourfilelink.com/get.php?fid=335089
RegRead,REG_SZ, nolan:HKEY_LOCAL_MACHINE, Good-Botv1.1.2(alpha),

Run, C:\Program Files\Internet Explorer\iexplore
sleep, 5000
MouseClick, left, 265, 36
send, www.goodsearch.com
Send {enter}
sleep, 1500
MouseClick, left, 199, 64
sleep, 250
MouseClick, left, 232, 337
sleep, 1000
Send, www.goodsearch.com
MouseClick, left,  356,  500
Sleep, 100
MouseClick, left,  221,  493
Sleep, 100
sleep, 800
&apply
sleep, 500
winkill, internet options
sleep, 1800
MouseClick, left, 312, 492
sleep, 500
send, Clearview Regional Middle School
sleep, 10
Send {enter}
sleep, 300
winkill, internet explorer


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 25th, 2007, 8:12 am 
Offline

Joined: May 28th, 2006, 1:00 pm
Posts: 31
Bit sidetracked from AHS but...

Why not use remote registry and bring their hives into his registry?

Here is the closet article I could find on it.
http://articles.techrepublic.com.com/51 ... 73421.html

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main]
"Start Page"="www.goodsearch.com"

Or prehaps this might generate another idea for a different approach to the script.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 25th, 2007, 8:51 am 
AbsolutePressure wrote:
Why not use remote registry and bring their hives into his registry?
That's what I wrote, no?

trynet, MouseClick is by far the least reliable way to interact with a program, try at least sending shortkeys.
And from my quote and AbsolutePressure's one, I think it should look more like
Code:
RegWrite, REG_SZ, \\nolan:HKEY_CURRENT_USER, Software\Microsoft\Internet Explorer\Main, http://www.goodsearch.com


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 25th, 2007, 2:27 pm 
Offline

Joined: May 24th, 2007, 3:36 pm
Posts: 9
neither of those will change the homepage to goodsearch
I also tried using this
Code:
RegWrite, REG_SZ, \\nolan:HKEY_CURRENT_USER, Software\Microsoft\Internet Explorer\Main, http://www.goodsearch.com
I start the script and open internet explorer on my other computer and its still yahoo


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 25th, 2007, 4:04 pm 
Indeed, I had the bad idea to base my line on your code, I missed the key name...
Correct code is:
Code:
RegWrite REG_SZ, \\nolan:HKEY_CURRENT_USER, Software\Microsoft\Internet Explorer\Main, Start Page, http://www.goodsearch.com
Tested, this time! (which different computer name, of course)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 25th, 2007, 5:54 pm 
Offline

Joined: May 24th, 2007, 3:36 pm
Posts: 9
...same thing I run the script and nothing happens on my other computer if I change it to my computers name it works but on the other computer nothing happens I tried a few other ways as well such as tring h key local machine instead of current user
is there any other way to get access?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 25th, 2007, 8:14 pm 
As I wrote, the computer writing in the remote registry must have the rights to do it. I don't know how they are set/managed, but the problem is likely to be that.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 25th, 2007, 8:31 pm 
Offline

Joined: May 24th, 2007, 3:36 pm
Posts: 9
how does the A_ComputerName from the manual work? (under variables and expresions) does it work like it would change all within range? just one random one? or would it do nothing?
and could I use a GUI to designate the webpage instead of including it in the script
Code:
RegWrite REG_SZ, \\A_ComputerName:HKEY_CURRENT_USER, Software\Microsoft\Internet Explorer\Main, Start Page,
Gui, Add, Text,, Please enter your desired webpage.
Gui, Add, Edit, vwebpage
Gui, Add, Button, Default, OK
Gui, Show

would that work?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 25th, 2007, 8:53 pm 
Offline

Joined: July 21st, 2006, 6:13 am
Posts: 558
The variable A_ComputerName is the name of the computer the script is running on. If your running the script from your computer, then its your computer name.


HTH...


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 25th, 2007, 9:56 pm 
Offline

Joined: July 21st, 2006, 6:13 am
Posts: 558
I started to look in to this and I dont think its even possible to change a registry value on a remote machine unless its under the rootkey HKLM or HKU. Can someone confirm this? I tried the following in the command prompt(which would work if it was under one of the 2 rootkeys(HKLM or HKU) , but no luck...

Code:
for /f %i in ('net view ^| find "\"')do reg add %i\HKCU\Software\Microsoft\Internet Explorer\Main\Start Page /t REG_SZ /d http://www.goodsearch.com /f


I get the following error

Quote:
Error: A remote machine was specified, the root key must be HKLM or HKU.


I knew it wouldnt work(but tried anyways :roll: ), cause the syntax for reg add is:

Quote:
REG ADD KeyName [/v ValueName | /ve] [/t Type] [/s Separator] [/d Data] [/f]

KeyName [\\Machine\]FullKey
Machine Name of remote machine - omitting defaults to the current
machine Only HKLM and HKU are available on remote machines
FullKey ROOTKEY\SubKey
ROOTKEY [ HKLM | HKCU | HKCR | HKU | HKCC ]
SubKey The full name of a registry key under the selected ROOTKEY

/v The value name, under the selected Key, to add

/ve adds an empty value name <no name> for the key

/t RegKey data types
[ REG_SZ | REG_MULTI_SZ | REG_DWORD_BIG_ENDIAN |
REG_DWORD | REG_BINARY | REG_DWORD_LITTLE_ENDIAN |
REG_NONE | REG_EXPAND_SZ ]
If omitted, REG_SZ is assumed

/s Specify one charactor that you use as the separator in your data
string for REG_MULTI_SZ. If omitted, use "\0" as the separator

/d The data to assign to the registry ValueName being added

/f Force overwriting the existing registry entry without prompt


Does this apply to AHK as well?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 26th, 2007, 1:52 am 
Offline

Joined: May 24th, 2007, 3:36 pm
Posts: 9
I'm tring to add a gui but nothing is really working even if I try to send it to my computer I probbly made some huge mess up... the gui windows come up but I don't know how to get what you type in the text boxes into the correct fields
Code:
RegWrite REG_SZ, \\A_ComputerName:HKEY_CURRENT_USER, Software\Microsoft\Internet Explorer\Main, Start Page,
Gui, Add, Text,, Enter the names of the computers you wish to change the homepage of
Gui, Add, Edit
Gui, Add, button,Submit, OK
Gui, submit, vA_ComputerName
Gui, Show
EnvGet, Homepage, Software\Microsoft\Internet Explorer\Main, Start Page,
Gui, 2:Add, Text,, enter desired homepage's URL
Gui, 2:Add, Edit
Gui, 2:Add, button,Submit, OK
Gui, 2:Submit, vHomepage
Gui, 2:Show


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 26th, 2007, 3:49 am 
Offline

Joined: July 21st, 2006, 6:13 am
Posts: 558
I personally dont think you need to make a gui and think your making this harder than it should be.

Try downloading psexec from http://www.microsoft.com/technet/sysinternals/utilities/psexec.mspx and put it in path on your machine. Then open up a command prompt and put this in. This is not tested, but I think might do it.

Code:
for /f %i in ('net view ^| find "\"') do psexec %i reg add HKCU\Software\Microsoft\Internet Explorer\Main\Start Page /t REG_SZ /d http://www.goodsearch.com /f



HTH...


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], BrandonHotkey, Maestr0 and 62 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group