SitePoint Sponsor |
|
User Tag List
Results 51 to 75 of 122
Thread: Web Page screen shot!!!
-
Jan 2, 2003, 21:14 #51
- Join Date
- Dec 2001
- Location
- Sioux City, Iowa
- Posts
- 691
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
How about:
Code:<?php $url = 'http://hotmail.com'; $exec = " Set WshShell = WScript.CreateObject(\"WScript.Shell\") WshShell.Run \"iexplore.exe\" WshShell.AppActivate \"Internet Explorer\" WshShell.SendKeys \"%D\" WshShell.SendKeys \"$url{ENTER}\" WScript.Sleep 2000 WshShell.Run(\"C:\\HQScreen.exe 0 PNG 8 picture C:\\\") "; exec ($exec); ?>
Last edited by Trav; Jan 2, 2003 at 21:18.
-
Jan 2, 2003, 21:16 #52
- Join Date
- Oct 2002
- Posts
- 69
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Interesting... putting all of it in a PHP file. I'll give that a try.
-
Jan 2, 2003, 21:23 #53
- Join Date
- Oct 2002
- Posts
- 69
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I tried it... and it doesn't seem to do anything. No errors pop up though.
-
Jan 2, 2003, 21:33 #54
- Join Date
- Dec 2001
- Location
- Sioux City, Iowa
- Posts
- 691
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
It might not be parsing it as a VBS file. Maybe you should store it as a file them run it.
Code:<?php $url = 'http://www.hotmail.com'; $exec = " Set WshShell = WScript.CreateObject(\"WScript.Shell\") WshShell.Run \"iexplore.exe\" WshShell.AppActivate \"Internet Explorer\" WshShell.SendKeys \"%D\" WshShell.SendKeys \"$url{ENTER}\" WScript.Sleep 2000 WshShell.Run(\"C:\\HQScreen.exe 0 PNG 8 picture C:\\\") "; $fp = fopen ('temp.vbs', w); fputs ($fp, $exec); fclose ($fp); exec ('temp.vbs'); ?>
-
Jan 2, 2003, 21:42 #55
- Join Date
- Oct 2002
- Posts
- 69
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
It works... I modified it a bit though:
PHP Code:<?php
$url = 'http://www.hotmail.com';
$exec = "
Set WshShell = WScript.CreateObject(\"WScript.Shell\")
WshShell.Run \"$url\"
WScript.Sleep 5000
WshShell.Run(\"C:\HQScreen.exe 0 PNG 8 picture C:\\\")";
$fp = fopen ('temp.vbs', w);
fputs ($fp, $exec);
fclose ($fp);
exec ('temp.vbs');
?>
-
Jan 2, 2003, 22:09 #56
- Join Date
- Dec 2001
- Location
- Sioux City, Iowa
- Posts
- 691
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Now all we need to do is make a *nix one...
-
Jan 2, 2003, 22:12 #57
- Join Date
- Oct 2002
- Posts
- 69
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
It's all done... I'll post all the code later.
-
Jan 2, 2003, 22:26 #58
- Join Date
- Nov 2000
- Posts
- 15
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Good idea about embedding the entire script in PHP -- hadn't thought of that. The other option would be to use arguments to the script in which case you would have two files, the PHP and then the WSH script.
PHP:
PHP Code:<?php
$url = "http://www.hotmail.com";
exec("script.vbs $url");
?>
[VBS]Set WshShell = WScript.CreateObject("WScript.Shell")
'Arg() is an array of the arguments, so Arg(0) is the first
WshShell.Run Args(0)
WScript.Sleep 5000
WshShell.Run("C:\HQScreen.exe 0 PNG 8 picture C:\")[/VBS]
You can then delete any temporary files using this code:
[VBS]Set FileSystem = CreateObject ("Scripting.FileSystemObject")
'set the file
Set TempFile = FileSystem.GetFile("c:\temp\test.txt")
'delete the file
TempFile.Delete[/VBS]
SimonWinGuides.com - Windows Guide Network
Empowering the Windows operating system.
-
Jan 2, 2003, 22:55 #59
- Join Date
- Oct 2002
- Posts
- 69
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Simon,
I tried your method, but I received the error "Type Error: Args". Here's the code for the PHP file:
Code:<?php if (file_exists('C:\\picture001.png')){ unlink('C:\\picture001.png'); } $url = "http://www.yahoo.com"; exec("C:/script.vbs $url"); ?>
Here is script.vbs:
Code:'VBScript Example Set WshShell = WScript.CreateObject("WScript.Shell") WshShell.Run Args(0) 'sleep for 5 seconds WScript.Sleep 5000 WshShell.Run("C:\HQScreen.exe 0 PNG 8 picture C:\") 'sleep for 3 seconds WScript.Sleep 3000 WshShell.Run("FTP -s:C:\ftp.txt") ' alt+F4 to Close Window WshShell.SendKeys "%{F4}"
Code:open ftp.yourserver.com username password lcd C:\ cd www binary put picture001.png bye
Can you see what's wrong with the Args thing?
Peter
-
Jan 2, 2003, 23:34 #60
- Join Date
- Nov 2000
- Posts
- 15
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Woops, my fault. I left out one line "Set Args = WScript.Arguments" -- try this:
[VBS]'VBScript Example
Set WshShell = WScript.CreateObject("WScript.Shell")
Set Args = WScript.Arguments
WshShell.Run Args(0)
'sleep for 5 seconds
WScript.Sleep 5000
WshShell.Run("C:\HQScreen.exe 0 PNG 8 picture C:\")
'sleep for 3 seconds
WScript.Sleep 3000
WshShell.Run("FTP -s:C:\ftp.txt")
' alt+F4 to Close Window
WshShell.SendKeys "%{F4}"[/VBS]
SimonWinGuides.com - Windows Guide Network
Empowering the Windows operating system.
-
Jan 3, 2003, 15:53 #61
- Join Date
- Mar 2002
- Location
- Columbia, South Carolina
- Posts
- 304
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
where can I get HQScreen.exe? I looked all oever on google but got nothing.
-
Jan 3, 2003, 15:54 #62
- Join Date
- Oct 2002
- Posts
- 229
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally posted by Clete2
where can I get HQScreen.exe? I looked all oever on google but got nothing.
Also, can this be run from a web server...Eternity
-
Jan 3, 2003, 17:19 #63
- Join Date
- Dec 2001
- Location
- Sioux City, Iowa
- Posts
- 691
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
This can be run from a Windows webserver, yes.
-
Jan 3, 2003, 17:29 #64
- Join Date
- Oct 2002
- Posts
- 69
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Here's the link to download the capture program:
http://download.com.com/3000-2094-90...ml?tag=lst-0-1
A note about the script though... if you plan to allow public access make sure to put some type of protection in so that only one user can use it at once. Because if it gets two requests at the same time, someone isn't going to get their screenshot. Also, make sure to put the security of the webbrowser at its highest level. Example: disable java, javascript, cookies... and anything else that may be dangerous.
I'd like to put a demo of this up on the web, but for VERY obvious reasons I don't feel like given out the IP address of my Windows machine. Does anyone know of a free host that offers PHP support (UNIX or Windows, it doesn't matter). I'll link the host to the machine running the screen capture program in order to mask the IP address of it.
Peter
-
Jan 3, 2003, 17:36 #65
- Join Date
- Mar 2002
- Location
- Columbia, South Carolina
- Posts
- 304
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
h4x0r me -> 216.143.50.59 <- my firewalls are all off lol (also you can see what of my site is up there untill my host is setup) (no joke)
-
Jan 3, 2003, 17:42 #66
- Join Date
- Mar 2002
- Location
- Columbia, South Carolina
- Posts
- 304
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
somehow, my PHP script is not executing right, it used to wait the time but now it goes *snap* and loads instantly
EDIT: Thanks
EDIT: I edited the file to instead of upload, copy it to my apache folder
EDIT: and oh, I do not understand what this is for:
WshShell.SendKeys "%{F4}"
are you making the computer type F4? if so, why?
EDIT: STUPID ME, I did not notice the comment above it LOLLast edited by Clete2; Jan 3, 2003 at 17:50.
-
Jan 3, 2003, 18:04 #67
- Join Date
- Jun 2001
- Location
- In your basement
- Posts
- 1,268
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Clete, why not give us a URL to the script running on your server, so I don't have to URL hack ;P
Eric Coleman
We're consentratin' on fallin' apart
We were contenders, now throwin' the fight
I just wanna believe, I just wanna believe in us
-
Jan 3, 2003, 18:07 #68
- Join Date
- Mar 2002
- Location
- Columbia, South Carolina
- Posts
- 304
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
:P ok:
http://216.143.50.59/test/
EDIT: Here is what I modified:
File = C:\ftp.txt:
Code:copy C:\picture001.png C:\Program Files\Apache Group\Apache\htdocs\picture001.png
[vbs]'VBScript Example
Set WshShell = WScript.CreateObject("WScript.Shell")
Set Args = WScript.Arguments
WshShell.Run Args(0)
'sleep for 5 seconds
WScript.Sleep 5000
WshShell.Run("C:\HQScreen.exe 0 PNG 8 picture C:\")
'sleep for 3 seconds
WScript.Sleep 3000
WshShell.Run("C:\ftp.txt")
' alt+F4 to Close Window
WshShell.SendKeys "%{F4}"[/vbs]
File = C:\Program Files\Apache Group\Apache\htdocs\test\index.php
PHP Code:<?php
if (file_exists('C:\\picture001.png')){
unlink('C:\\picture001.png');
}
$url = "http://www.yahoo.com";
exec("C:/script.vbs $url");
?>Last edited by Clete2; Jan 3, 2003 at 18:12.
-
Jan 3, 2003, 18:09 #69
- Join Date
- Jun 2001
- Location
- In your basement
- Posts
- 1,268
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
WOW!! UBER SEXY!
.
.
.
.
.
.
.
.
.
.
.
I got a blank page ;PEric Coleman
We're consentratin' on fallin' apart
We were contenders, now throwin' the fight
I just wanna believe, I just wanna believe in us
-
Jan 3, 2003, 18:13 #70
- Join Date
- Mar 2002
- Location
- Columbia, South Carolina
- Posts
- 304
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
yeah me too, beauty...
EDIT: somehow when I posted the code, the unlink had one \ and in the code it has 2 lol my comp is screwy
-
Jan 3, 2003, 18:14 #71
- Join Date
- Jun 2001
- Location
- In your basement
- Posts
- 1,268
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Why not link it to te screen shot that was just taken!
Eric Coleman
We're consentratin' on fallin' apart
We were contenders, now throwin' the fight
I just wanna believe, I just wanna believe in us
-
Jan 3, 2003, 18:15 #72
- Join Date
- Mar 2002
- Location
- Columbia, South Carolina
- Posts
- 304
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally posted by Zaire
Why not link it to te screen shot that was just taken!
EDIT: I need to quit posting, this it turning into SpAm!
EDIT: OK I put a little link to the snapshot which is supposed to be thereLast edited by Clete2; Jan 3, 2003 at 18:17.
-
Jan 3, 2003, 18:17 #73
- Join Date
- Jun 2001
- Location
- In your basement
- Posts
- 1,268
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally posted by Clete2
well why not wait untill it works? It's not taking a screenshot lol that's why I want help
EDIT: I need to quit posting, this it turning into SpAm!Eric Coleman
We're consentratin' on fallin' apart
We were contenders, now throwin' the fight
I just wanna believe, I just wanna believe in us
-
Jan 3, 2003, 18:20 #74
- Join Date
- Mar 2002
- Location
- Columbia, South Carolina
- Posts
- 304
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
OH when running script.vbs in the command line I get some error 'Script: C:\script.vbs
Line: 5
Char: 1
Error: Subscript out of range
Code: 800A0009
Source: microsux VBScript runtime error'
EDIT: I have conducted an extensive research and determined that line 5 char 1 is:
W
lines 4 and 5:
Code:Set Args = WScript.Arguments WshShell.Run Args(0)
-
Jan 3, 2003, 18:23 #75
- Join Date
- Oct 2002
- Posts
- 69
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
This is where the URL fits into the VBS script...
[VBS]
Set Args = WScript.Arguments
WshShell.Run Args(0)
[/VBS]
It gets the first argument in the array (in this case $url) and runs it.
Since no one seems to be able to get it running, I'll set it up on my home computer... I just need to up the security of the script a bit.
Bookmarks