Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

Dos shell short cut needed for X5


Gramby
 Share

Recommended Posts

Looking to get a short cut Dos Shell Icon added to my toolbar in X5. This is how I run my batch file to get .mcx and .nc files to our network for the cnc operators to get access to. Has the Dos shell been added to X5 yet? I beleive it was in most versions thru V9. When X came out it was eliminated. Somehow 6 years ago a coworker got hold of 3 files to add to our X installation in order to get a Dos shell icon short cut.

Their are 3 files. Dos_Shell.dll , Dos_Shell.ft and Dos_Shell.vbs. the first 2 are placed in the chooks folder and the last file which is .vbs is placed in the vb folder.

On each upgrade since 2005 I would always copy those files to the appropiate folder and have my Dos shell short cut. It would put a icon in my Keymapping Category Net Hook folder. Which I had selected for my custom tool bar.

Obviously I copied those folders over in X5 to the appropiate folders. But it is not giving me my icons. Seems do to the new X5 file structure it is not working.

Does anyone have a solution to get quick access with to a Dos shell prompt while in Mastercam? Maybe a windows key stroke? Why did Mastercam ever remove it in the first place?

Link to comment
Share on other sites

Have you tried File/Edit Open external

It's not an ico, but it may allow you to

launch your vbs script.

If that works, you may be able to use the macro

builder to build a routine you can assign to an

icon

Thanks for the suggestion but it didn't launch the vbs script but rather opened it to be edited. As shown below.

 

'////////////////////////////////////////////////////////////////////////////////

'//

'// Author:

'// Date: 11/06/2005 06:15 AM

'// File Name: DOS_Shell.vbs

'//

'// Description: Mastercam VB Script

'//

'// Comments: Fire up the DOS CMD window

'//

'////////////////////////////////////////////////////////////////////////////////

'///////////////// My Constants /////////////////

' <none>

'///////////////// My Global Variables //////////

' <none.

' -- Start Script

Call Main()

' ////////////////////

' Sub Declaration

' ////////////////////

Sub Main()

 

Dim objShell

Set objShell = CreateObject ("WSCript.shell")

objShell.run "cmd /K CD C:\Documents and Settings\All Users\Documents\shared mcamx5\vb"

Set objShell = Nothing

End Sub

Link to comment
Share on other sites

Good ideas I guess I was not thinking outside the box. Been using Dos Shell up thur X4 and just had it in my mind to continue in X5. Yes Windows have a Dos Command prompt. I just added one to my quick launch toolbar but may delelte it. Because I created a windows hot key "Ctrl+alt+C" that will open now open Dos Command prompt. Problem solved. thanks

Although I have a new problem with X5. My batch file that I use to copy programs from my harddrive to the network will not work. Yes I did modify the batch file path to direct it to the appropiate folders. The problem is related to the new file structure of X5. With the .NC file stored deep within C:\Documents and Settings\my.LEDFORDAD\My Documents\my mcamx5\Mill\NC a Dos batch file will not work if the file path has spaces. You suppose to be able to add quotes "" around the file path to get around this but I still haven't gotten it to work.

copy “C:\Documents and Settings\my.LEDFORDAD\My Documents\my mcamx5\Mill\NC\%1."nc Q:\Vol1\PROGRAMS

 

copy "C:\Documents and Settings\my.LEDFORDAD\My Documents\my mcamx5\Mill\NC\"%1.nc Q:\Vol1\PROGRAMS

 

copy “C:\Documents and Settings\my.LEDFORDAD\My Documents\my mcamx5\Mill\NC\%1.nc” Q:\Vol1\PROGRAMS

 

I currently only see 3 options for me.

1. Create a NC folder in a better location such as C:\NC and direct my mastercam config to store files their.

2. Try to Map a new drive letter to the .NC folder in C:\Documents and Settings\my.LEDFORDAD\My Documents\my mcamx5\Mill\NC then modify my batch file to that new mapped Drive. I did attempted this but while setting up a Map drive it would only show network info about printers and not a thing on my hard drive. If i must go this way. Calling in our outsude network administrator may be neccessary?

3. figure out how to get a Dos command to read a long file name with spaces. Using quotes "

 

Any ideas I may be over looking?? thanks

Link to comment
Share on other sites

Gramby - Are you sure the error is in that it has spaces or that permission is denied reading from c:\users\<username>? You may want to try running your script as an administrator once, right click on it and choose "run as administrator" and that might cure your woes.

 

Of the list above, your third one would be the correct format, I believe.

 

Edit: What version of windows are we talking about here? XP, XP64, 7, 7 64-bit, etc? It looks like XP from your paths...

Link to comment
Share on other sites

Gramby - Are you sure the error is in that it has spaces or that permission is denied reading from c:\users\<username>? You may want to try running your script as an administrator once, right click on it and choose "run as administrator" and that might cure your woes.

 

Of the list above, your third one would be the correct format, I believe.

 

Edit: What version of windows are we talking about here? XP, XP64, 7, 7 64-bit, etc? It looks like XP from your paths...

 

Thanks - No I am not sure the error is space related. Using Windows XP. Not sure what you're suggesting to right click on. I tried right clicking the .bat file that includes the Dos commands and I see no "run as administrator" option

 

So you got me thinking so I did a test. I created a junk folder that had a name with spaces. I put a file in the folder to transfer.

The folder name was C:\junk my doucuments settings

 

I ran this batch and got a error "Invalid number of parameters"

cls

xcopy “C:\junk my documents settings\%1.nc” Q:\Vol1\PROGRAMS

 

 

For a test I took out the spaces to make it look like this and it copied the file to the network fine.

C:\junkmydoucumentssettings

 

cls

xcopy C:\junkmydoucumentssettings\%1.nc Q:\Vol1\PROGRAMS

 

What a pain.

Link to comment
Share on other sites

goto system32 dir

right click & drag CMD.EXE outta there and place it on your desktop

select create shortcut

 

be sure not to move it

 

you can also copy it I believe

 

EDIT I double checked and it is CMD.exe. it will set up a shortcut for the console.

 

I am not sure if that is what you want. Been a while since I thought about DOSSHELL...

Link to comment
Share on other sites

Gramby - Sorry in the delay, it took me that long to find an XP computer to test on :) We don't really have any laying around the office, and I realized my wife's laptop has it tonight.. All of that "run as administrator" stuff pertains to windows 7, so don't worry about that. Either way, I would like you to try something when you have a second.

 

Using this code,

xcopy “C:\junk my documents settings\%1.nc” Q:\Vol1\PROGRAMS

Change the %1 to %%1.nc , sometimes that helps.

 

The next step, could you post the entire code of your script? I'd like to see how/where %1 is defined.

 

Thanks!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...