Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: IT gurus - need your advice please!  (Read 2759 times)

0 Members and 1 Guest are viewing this topic.

MrThunderwing

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1087
  • Last login:July 05, 2025, 10:58:29 am
  • As I pass, do I give you the ass or the crotch?
IT gurus - need your advice please!
« on: June 19, 2024, 04:41:53 am »
Howdy all,

I need a bit of advice with a batch file conundrum I'm having, I was wondering if one of you more tech savvy geniuses might be able to help, please?

I'm not super coding savvy, but I've picked up a few bits here and there from various gaming forums and the like.

I've tried to use this to streamline one aspect of my regular work life by writing a batch file to open all the folder I need to use in the day in one single click, rather than manually opening each one, and also the programs I need too, usually a word document and 2 excel files. I can open up the folders no problem. I can open a file with no issue if there's no space in the name i.e

Code: [Select]
start /D "M:\Documents\Alex" excel.exe Calculations.xlsx
start /D "C:\Users\OneDrive\Documents" CR-APC.docx

But if the file has a space in its name, so for example, the Excel document is called something like "Weekly Name List 2024.xlsx" or the Word document is "Weekly Priorities.docx" the batch file throws up an error. I've tried to Google a solution, but I can't find anything that seems to specifically cover this issue, the answers to the no-spaces-in-batch-files answers all seem a bit above my level of comprehension, with lots of extra stuff I don't have a clue about. I've been able to just rename some of the files to just get rid of the spaces, but some of these are shared documents so I can't do that with them.

Does anyone know how I can alter the batch files to read the Excel and Word douments with spaces in them?

Thanks!



thebyter

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 27
  • Last login:Yesterday at 01:35:25 am
Re: IT gurus - need your advice please!
« Reply #1 on: June 19, 2024, 02:31:30 pm »
You need to put the filenames in double quotes (..."My File.txt").  However, when START sees bare double quotes, it uses that string as the window title:

Code: [Select]
C:\>start /?
Starts a separate window to run a specified program or command.

START ["title"] [/D path] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED]
      [/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL]
      [/NODE <NUMA node>] [/AFFINITY <hex affinity mask>] [/WAIT] [/B]
      [/MACHINE <x86|amd64|arm|arm64>][command/program] [parameters]

    "title"     Title to display in window title bar.
    ...

So you need to provide a window title, even a fake or empty one:

Code: [Select]
start "" /D "M:\Documents\Alex" excel.exe "June Calculations.xlsx"
Thanks!
The Byter

MrThunderwing

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1087
  • Last login:July 05, 2025, 10:58:29 am
  • As I pass, do I give you the ass or the crotch?
Re: IT gurus - need your advice please!
« Reply #2 on: June 19, 2024, 02:53:23 pm »
Nice one dude. I'll give that a try when I'm back in tomorrow, cheers