0

I am trying to run a bat file on startup (running Windows 8.1) that will change the permission of the temp folder and then run dropbox. The bat file executes properly on startup and does what I want but the cmd window appears and just stays there with the commands showing. I have to manually close the window for it to go away but other than that it works fine.

So is there a way for me to suppress the window. Here is the batch file code:

@ECHO OFF
echo y| CACLS "C:\Users\Name\AppData\Local\Temp" /grant Everyone:F
"C:\Users\Name\AppData\Roaming\Dropbox\bin\Dropbox.exe"
exit
Richard
  • 145
  • 3
  • 5
  • 15
  • 1
    You can do it with VBScript. [This](http://superuser.com/questions/62525/run-a-completly-hidden-batch-file) will help you. Also this question is possible duplicate of [this](http://superuser.com/questions/62525/run-a-completly-hidden-batch-file) – Jet May 20 '14 at 17:26
  • @Richard Try Jet's suggestion. Here is a second [link](http://superuser.com/a/701867/50173) for a good VBS example. – nixda May 20 '14 at 17:29
  • So much duplicates ?.. – Jet May 20 '14 at 17:32
  • @techie007 I edited my bat commands to have a `start` in front of the dropbox. So now it reads `start "C:\Users\Name\AppData\Roaming\Dropbox\bin\Dropbox.exe"` but I'm still getting a persistent cmd window that I have to manually close. Like I said, I don't care if it shows up I just want it to close automatically when it's done. – Richard May 20 '14 at 17:46

1 Answers1

1

Create a shortcut to the batch file and put this into your startup items. Edit the properties of the shortcut to run minimized...

You can't suppress the window entirely.

Kinnectus
  • 10,438
  • 3
  • 28
  • 41
  • this does not really help me as it just minimizes the window; I need it to close, I don't care if the window shows up for a few seconds as long as it closes it self after finishing. This minimization step just has it minimized on my taskbar until I manually pull it up and close it myself. – Richard May 20 '14 at 17:26
  • You can suppress the window entirely... – Jet May 20 '14 at 17:28
  • Your 'exit' command should close the window when the script completes so something is amiss somewhere... – Kinnectus May 20 '14 at 17:54
  • @Jet - how does this work unless it's a scheduled task or group policy? 'You learn something new every day' – Kinnectus May 20 '14 at 17:58