question

Mrs_Fatherjack avatar image
Mrs_Fatherjack asked

Management Studio External Tools

Has anyone successfully added a menu item from the External Tools options? To cut a very long story short I am trying to run a command line prompt from within Management Studio and have been recommended that setting it up as a External Tool Menu Item may be the way forward. The process I have to achieve is to run a command line prompt, find a path and then add a command to run a process. In the command line it would be: ![alt text][1] This is what I've entered in the External Tools information: ![alt text][2] But all that's happening is the command box is opening with the correct path but not actually firing the prompt. Any ideas greatfully received. [1]: /upfiles/CMdLineImage_1.png [2]: /upfiles/CmdLineImage2.png
sqlmanagement-studioexternal-tools
1 comment
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Congrats on 1K karma. Knew you'd get there :)
2 Likes 2 ·
Fatherjack avatar image
Fatherjack answered
that could be 'expected behaviour' its running the tool for you. If you press Enter does the command execute? Have you tried ticking the 'Close on exit' box or any other options there? EDIT I just tried it, dont use Close on Exit!!! EDIT 2 Have you tried using xp_cmdshell instead? What do you want to achieve?
18 comments
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

it closes SSMS :(
1 Like 1 ·
what is accurev is it an executable? If so put 'accurev.exe' or whatever the name of the exe is, with 'promote -k' as args?
1 Like 1 ·
if it works from any command window like that then it must have a PATH entry. I would suggest searching for files called accurev.*
1 Like 1 ·
I take it all back, there is no accurev.exe, but when you put that in the command prompt it works. I'm very very sorry for not doing that first.
1 Like 1 ·
It hasn't done what I expected it to have done, or what it does when run direct from the command line. I'm very confused. Out of interest what happens when you use Close on Exit?
0 Likes 0 ·
Show more comments
KenJ avatar image
KenJ answered
Presuming the -k is the cmd.exe parameter to keep the command window open when the command completes... Arguments: `/K accurev promote` If -k is an accurev parameter Arguments: `/K accurev promote -k` You can use /C with cmd.exe if you want the window to close when the command completes. Without /C or /K cmd.exe doesn't know you are passing it a command to execute
5 comments
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

+1 woohoo it works for my test
1 Like 1 ·
@KenJ - I think the -k is a switch on 'accurev' and not on 'cmd'
0 Likes 0 ·
Had the same feeling, @Kev Riley - just added an edit for that.
0 Likes 0 ·
Many thanks for all the help, it's now working by putting accurev.exe in the command field, even though there is no accurev.exe that I can find anywhere.
0 Likes 0 ·
If it works in the command field, it's either in the "Initial Directory" or in one of the locations in your system's path variable (c:\>echo %path%) It could also have a non-.exe extension such as .com or .bat
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.