SitePoint Sponsor

User Tag List

Page 3 of 5 FirstFirst 12345 LastLast
Results 51 to 75 of 122
  1. #51
    Super Ninja Monkey Travis's Avatar
    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);
    ?>
    Note: I've made a couple fixes to this code.
    Last edited by Trav; Jan 2, 2003 at 20:18.
    Travis Watkins - Hyperactive Coder
    My Blog: Realist Anew
    Projects: Alacarte - Gnome Menu Editor

  2. #52
    SitePoint Enthusiast
    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.

  3. #53
    SitePoint Enthusiast
    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.

  4. #54
    Super Ninja Monkey Travis's Avatar
    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');
    ?>
    edit: PHP tags are starting to really piss me off
    Travis Watkins - Hyperactive Coder
    My Blog: Realist Anew
    Projects: Alacarte - Gnome Menu Editor

  5. #55
    SitePoint Enthusiast
    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');
    ?>
    I'm going to add the FTP capabilities to it now...

  6. #56
    Super Ninja Monkey Travis's Avatar
    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...
    Travis Watkins - Hyperactive Coder
    My Blog: Realist Anew
    Projects: Alacarte - Gnome Menu Editor

  7. #57
    SitePoint Enthusiast
    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.

  8. #58
    SitePoint Member
    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");

    ?>
    And the WSH VBscript:
    [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]

    Simon
    WinGuides.com - Windows Guide Network
    Empowering the Windows operating system.

  9. #59
    SitePoint Enthusiast
    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");
    
    
    ?>
    I delete the picture at the beginning because the capture program won't overwrite existing files, it just increments the file number.

    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}"
    Finally, here is ftp.txt:

    Code:
    open ftp.yourserver.com
    username
    password
    lcd C:\
    cd www
    binary
    put picture001.png
    bye
    I'm not posting the server address, username, and password for obvious reasons

    Can you see what's wrong with the Args thing?

    Peter

  10. #60
    SitePoint Member
    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]

    Simon
    WinGuides.com - Windows Guide Network
    Empowering the Windows operating system.

  11. #61
    SitePoint Addict Clete2's Avatar
    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.
    My Blog
    My Photography Website
    Linux user #339185

  12. #62
    SitePoint Addict
    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.
    Was about to ask the same thing

    Also, can this be run from a web server...
    Eternity

  13. #63
    Super Ninja Monkey Travis's Avatar
    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.
    Travis Watkins - Hyperactive Coder
    My Blog: Realist Anew
    Projects: Alacarte - Gnome Menu Editor

  14. #64
    SitePoint Enthusiast
    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

  15. #65
    SitePoint Addict Clete2's Avatar
    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)
    My Blog
    My Photography Website
    Linux user #339185

  16. #66
    SitePoint Addict Clete2's Avatar
    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 LOL
    Last edited by Clete2; Jan 3, 2003 at 16:50.
    My Blog
    My Photography Website
    Linux user #339185

  17. #67
    Ribbit... Eric.Coleman's Avatar
    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

  18. #68
    SitePoint Addict Clete2's Avatar
    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
    File = C:\script.vbs

    [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");


    ?>
    EDIT: I do not see in the vbs script where $url fits in, but I only know vb not vbs and I have forgotten most of what I know
    Last edited by Clete2; Jan 3, 2003 at 17:12.
    My Blog
    My Photography Website
    Linux user #339185

  19. #69
    Ribbit... Eric.Coleman's Avatar
    Join Date
    Jun 2001
    Location
    In your basement
    Posts
    1,268
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Clete2
    :P ok:

    http://216.143.50.59/test/

    WOW!! UBER SEXY!
    .
    .
    .
    .
    .
    .
    .
    .
    .
    .
    .
    I got a blank page ;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

  20. #70
    SitePoint Addict Clete2's Avatar
    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
    My Blog
    My Photography Website
    Linux user #339185

  21. #71
    Ribbit... Eric.Coleman's Avatar
    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

  22. #72
    SitePoint Addict Clete2's Avatar
    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!
    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!

    EDIT: OK I put a little link to the snapshot which is supposed to be there
    Last edited by Clete2; Jan 3, 2003 at 17:17.
    My Blog
    My Photography Website
    Linux user #339185

  23. #73
    Ribbit... Eric.Coleman's Avatar
    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!
    Ohh.. lmfao.. I was under the impression that it was working
    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

  24. #74
    SitePoint Addict Clete2's Avatar
    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)
    EDIT: OK GOTTA QUIT SAPMMING
    My Blog
    My Photography Website
    Linux user #339185

  25. #75
    SitePoint Enthusiast
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •