Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: VBScript Script File

11 Aug 2015   #1

Windows 7 Ultimate x64
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 System SpecsSystem Spec
12 Aug 2015   #2

Windows 7 Ultimate x64

Does anyone know if this is possible? maybe a link to teach me how to write it.
My System SpecsSystem Spec
12 Aug 2015   #3

Windows 7 Professional x64, RHEL 5,6,7

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)

My System SpecsSystem Spec

12 Aug 2015   #4

Windows 7 Ultimate x64

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 System SpecsSystem Spec
12 Aug 2015   #5

Windows 7 Professional x64, RHEL 5,6,7

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 System SpecsSystem Spec

 VBScript Script File

Thread Tools

Similar help and support threads
Thread Forum
CScript Error: Can't find script engine "VBScript" -alternate solution
I just came across this error in troubleshooting an MGADiag report to solve a non-genuine message on a Vista computer. It took me a large amount of searching to find the right answer to it - so I thought I'd post my solution here in the hope that it gets a little easier to find for others in the...
Windows Updates & Activation
New VBScript File - Add to Context Menu
How to Add "New VBScript File" to the Context Menu in Windows This tutorial will show you how to add VBScript Script File to the right click "New" context menu to make creating a new VBS file easier for all users in Vista, Windows 7, and Windows 8. You will need to be logged in as...
Windows Script Host: Can not find script file ?
Hello & Thanks , win7 x64 Starting yesterday , I keep getting the following message: Windows Script Host Can not find script file "C:\ProgramData\{95137DD0-C591-AC56-7417-DCD4A4950F5A}\\lare.txt". Any idea why and how to fix it ? Thanks/ ...Vern Tags: win7 x64, Download Games...
General Discussion
Getting CScript Error: Can't find script engine "VBScript".
I don't remember when was the first time I got this error... I think that was April '11... Here, to be precise: I must have spent my time trying to fix it...but got nothing... So, yesterday...I ran...
Windows Updates & Activation
Can't Find Script Engine - VBScript
Hi, I'm having the above titled problem after I removed Kaspersky Internet Security 2011 from the system. Already tried KAV Remover & other uninstall softwares to clean up the Kaspersky's leftovers. Also tried various methods; re-register regsvr32 jscript.dll / regsvr32 vbscript.dll / etc.. ...
General Discussion

Our Sites

Site Links

About Us

Find 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 18:20.
Twitter Facebook Google+