VBScript Script File


  1. Posts : 8
    Windows 7 Ultimate x64
       #1

    VBScript Script File


    Can someone help me make a Script file to open or close Dropbox.Exe?

    Path = C:\Users\Larry\AppData\Roaming\Dropbox\bin\Dropbox.exe /home

    Would like to close dropbox from a excel workbook and restart it after the workbook closes.

    Thanks for any input
      My Computer


  2. Posts : 8
    Windows 7 Ultimate x64
    Thread Starter
       #2

    Does anyone know if this is possible? maybe a link to teach me how to write it.
    Thanks
      My Computer


  3. Posts : 16
    Windows 7 Professional x64, RHEL 5,6,7
       #3

    Hi, I'm sure there are many ways of doing this, but this should work...

    Note: I've not tested this with dropbox, so may need some adjusting.
    Note2: This will close dropbox as if you killed it from task manager - be sure that's what you want! (if there is a nice close switch for dropbox.exe, I would call that instead of using taskkill)

    To close dropbox.exe:
    Call Shell("taskkill /fi ""ImageName eq dropbox.exe""", vbHide)

    To open dropbox.exe:
    Call Shell("C:\Users\Larry\AppData\Roaming\Dropbox\bin\Dropbox.exe /home", vbNormalFocus)

    Obviously put these into whichever functions suit what you want to do the most (either attach them to buttons, or to the workbook open / beforeclose functions)

    Cheers,
    Jon
      My Computer


  4. Posts : 8
    Windows 7 Ultimate x64
    Thread Starter
       #4

    Thanks JonM will give it a try. Had the wrong location of exe,should of been C:\Program Files (x86)\Dropbox\Client\Dropbox.exe

    If I have dropbox open the script will not kill dropbox?
      My Computer


  5. Posts : 16
    Windows 7 Professional x64, RHEL 5,6,7
       #5

    Ok, You should be able to simply copy/paste the new location into the open command (remember the quotes).

    For the kill command, it might be falling foul of capitalisation (the exe is called "Dropbox" my command contains "dropbox")
    If you want to check, open task manager (Ctrl + Shift + Esc), have a look at the "Processes" tab and find Dropbox on there.
    The part that says "ImageName eq Dropbox.exe" should match whatever you find there.

    It should kill it even when its open - hence my warning above - it's not going to care whether its transferring files etc or not.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 01:21.
Find Us