+ Post New Thread
Results 1 to 3 of 3
Windows Vista Thread, BAT File issue in Technical; Hey, I am a photographer and am trying to make a .bat file to open photos when I take a ...
  1. #1

    Join Date
    Sep 2008
    Thank Post
    Thanked 1 Time in 1 Post
    Rep Power

    BAT File issue


    I am a photographer and am trying to make a .bat file to open photos when I take a photo onto my PC, I have canon software that will get it off my camera via the data lead but now I need to make a bat file to open it in windows gallery then 10 seconds later close it! But I cant get it to work!

    Here is that I have the first line works and opens the image, its the sleep for 10 seconds and the closing of windows gallery...

    C:\WINDOWS\system32\rundll32.exe C:\WINDOWS\System32\shimgvw.dll,ImageView_Fullscreen %~1
    sleep 10
    TASKKILL /F /IM "rundll32.exe"

    Any ideas?


  2. #2

    mattx's Avatar
    Join Date
    Jan 2007
    Thank Post
    Thanked 1,069 Times in 625 Posts
    Rep Power
    Would be easier using AutoIT.....
    Specially the Taskkill. Process close would be a better choice !!

    Checkout AutoIt Script Home Page

  3. #3

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Thank Post
    Thanked 1,107 Times in 1,014 Posts
    Rep Power
    Vbscript version below :

    Dim oShell
    Dim intSleep
    intSleep = 10 * 1000
    Set oShell = WScript.CreateObject ("WSCript.shell")
    Set WshNetwork = WScript.CreateObject("WScript.Network")
    oShell.run "rundll32.exe %SystemRoot%\system32\shimgvw.dll,ImageView_Fullscreen"
    wscript.sleep intSleep
    Dim objWMIService, objProcess, colProcess
    Dim strComputer, strProcessKill
    strComputer = WshNetwork.ComputerName
    strProcessKill = "'rundll32.exe'"
    Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" _
    & strComputer & "\root\cimv2")
    Set colProcess = objWMIService.ExecQuery _
    ("Select * from Win32_Process Where Name = " & strProcessKill )
    For Each objProcess in colProcess
    WSCript.Echo "Just killed process " & strProcessKill _
    & " on " & strComputer
    oShell = Nothing
    First attempt so appologies if it does not work or if there are some coding ommisions.

    You can get rid of the messagebox at the end of you wish just delete the 2 lines in bold in the coded example.

    You can download the text version below and rename the file extension from txt to vbs and run it
    Attached Files Attached Files
    Last edited by mac_shinobi; 14th March 2009 at 03:19 PM.

+ Post New Thread

Similar Threads

  1. SIMSPERM.bat
    By cookie_monster in forum MIS Systems
    Replies: 13
    Last Post: 14th May 2014, 03:02 PM
  2. The Bat
    By Dos_Box in forum General Chat
    Replies: 1
    Last Post: 11th July 2008, 02:19 PM
  3. Stopping SQL using a Bat file
    By ful56_uk in forum Windows
    Replies: 4
    Last Post: 7th April 2008, 01:09 AM
  4. simsperm.bat
    By robert.mabbutt in forum MIS Systems
    Replies: 9
    Last Post: 15th August 2007, 10:43 PM
  5. WS Security or simsperm.bat
    By techyphil in forum MIS Systems
    Replies: 9
    Last Post: 16th March 2007, 01:56 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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