Author Topic: Start acad.exe from a batch file  (Read 1618 times)

0 Members and 1 Guest are viewing this topic.

dubb

  • Swamp Rat
  • Posts: 1105
Start acad.exe from a batch file
« on: August 14, 2020, 01:11:21 PM »
I am trying to run acad.exe from a batch file.

Why does this not work for me?

Code: [Select]
@echo off
taskkill /IM "notepad.exe" /F
TIMEOUT /T 3
start "C:\Program Files\Autodesk\AutoCAD 2021" acad.exe

Crank

  • Water Moccasin
  • Posts: 1503
Re: Start acad.exe from a batch file
« Reply #1 on: August 14, 2020, 01:24:05 PM »
If the file path contains a space within a folder name, you need to enclose that folder name in double quotes.

So I think (not tested) , you could use:
Code: [Select]
START C:\"Program Files"\Autodesk\"AutoCAD 2021"\acad.exe
or:

Code: [Select]
START "C:\Program Files\Autodesk\AutoCAD 2021\acad.exe"
Vault Professional 2023     +     AEC Collection

dubb

  • Swamp Rat
  • Posts: 1105
Re: Start acad.exe from a batch file
« Reply #2 on: August 14, 2020, 01:26:47 PM »
Thanks my friend! That did it. Its confusing how dos handles spaces in directory names.
If the file path contains a space within a folder name, you need to enclose that folder name in double quotes.

So I think (not tested) , you could use:
Code: [Select]
START C:\"Program Files"\Autodesk\"AutoCAD 2021"\acad.exe
or:

Code: [Select]
START "C:\Program Files\Autodesk\AutoCAD 2021\acad.exe"

BIGAL

  • Swamp Rat
  • Posts: 1414
  • 40 + years of using Autocad
Re: Start acad.exe from a batch file
« Reply #3 on: August 16, 2020, 09:08:45 PM »
If your old enough file names were 8 characters, same with directories and a no no was a space so used - or _.

Lisp using command can fail on say a block having a space in its name, need to use \\ etc to work.
A man who never made a mistake never made anything

d2010

  • Bull Frog
  • Posts: 326
Re: Start acad.exe from a batch file
« Reply #4 on: August 21, 2020, 11:08:11 AM »
Code: [Select]
START "C:\Program Files\Autodesk\AutoCAD 2021\acad.exe"
You can execute assoc.exe and ftype.exe at ms-dos-console
  assoc mnc [enter]
  winstart.bat  AutoCADUtilityDefaults[enter]
You see Top-associate list of Extension Filename.
If you execute directly from explorer.exe , then you run "notepad.exe winstart.bat"
Code: [Select]
.mnc=AutoCADCompiledMenu
.ads=AutoCADADSAppFile
.ahp=AutoCADHelpFile
.bak=AutoCADBackupDWGFile
.bpl=AutoCADBatchPlotListFile
.dfs=AutoCADUtilityDefaults
.hdx=AutoCADHelpIndex
.iff=AutoCADIFFRasterFile
.old=AutoCADOriginalDrawing
.pcp=AutoCADPlotConfigurationParameters
« Last Edit: August 21, 2020, 11:13:40 AM by d2010 »