VBScript Script File

zplugger

New member
Local time
9:29 PM
Messages
8
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

Computer type
PC/Desktop
OS
Windows 7 Ultimate x64
Does anyone know if this is possible? maybe a link to teach me how to write it.
Thanks
 

My Computer

Computer type
PC/Desktop
OS
Windows 7 Ultimate x64
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

Computer type
PC/Desktop
OS
Windows 7 Professional x64, RHEL 5,6,7
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

Computer type
PC/Desktop
OS
Windows 7 Ultimate x64
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

Computer type
PC/Desktop
OS
Windows 7 Professional x64, RHEL 5,6,7
Back
Top