Do you remember MS DOS?


  #1  
Old 09-23-14, 07:58 AM
kolias's Avatar
Member
Thread Starter
Join Date: Jul 2004
Location: Canada
Posts: 1,689
Received 9 Upvotes on 9 Posts
Do you remember MS DOS?

We all remember DOS was the king back in the 80's

I try to open an Excel files thru the attached batch file but it opens the excel program and then it stops.

Anyone remembers what is the right syntax to open the "Summary.xls" file?
Instead of "open" I did try "start" and "run" with no success

@ECHO OFF
cd c:\program files (x86)\microsoft office\office10\excel.exe
start excel.exe
cd c:\utility1\Home\Excel\Summary.xls
open Summary.xls
exit
 
  #2  
Old 09-23-14, 08:55 AM
P
Temporarily Suspended
Join Date: Jul 2008
Location: NY
Posts: 10,265
Upvotes: 0
Received 0 Upvotes on 0 Posts
You are in the wrong directory. That directory just holds the binary to start excel. You can start excel from there by typing excel.exe & pressing enter.

If you want to open a particular file, cd to the directory where the file is located, type the name of the file & press enter. Then that file will open. Let's say it's in Documents
cd progra~1\kolias\docum~1
 
  #3  
Old 09-23-14, 10:50 AM
Z
Member
Join Date: Jan 2008
Location: Southeastern Pennsylvania
Posts: 3,386
Received 124 Upvotes on 115 Posts
If you want to do it from a bat file this should work from the bat file.You just need to pass the file name you want to open to excel as an argument on startup

@ECHO OFF
start "c:\program files (x86)\microsoft office\office10\excel.exe" "c:\utility1\Home\Excel\Summary.xls"
exit
 
  #4  
Old 09-23-14, 10:51 AM
kolias's Avatar
Member
Thread Starter
Join Date: Jul 2004
Location: Canada
Posts: 1,689
Received 9 Upvotes on 9 Posts
Thanks Pulpo but after a lot of trials and errors I solve my batch file problem and here it is for other members

@ECHO OFF
cd c:\program files (x86)\microsoft office\office10\excel.exe
start excel "C:\Utility1\Home\Excel\Summary.xls"
exit

I guess the brackets on the 3rd line did the trick

Now clicking on the batch takes me straight to my Summary.xls
 
  #5  
Old 09-23-14, 02:29 PM
kolias's Avatar
Member
Thread Starter
Join Date: Jul 2004
Location: Canada
Posts: 1,689
Received 9 Upvotes on 9 Posts
Now I got my .bat fixed I cant pin it to the taskbar or start screen. I tried to rename it to .txt but still no luck. Anyone knows why and how I can pin it to the taskbar?

Righclicking on it has no reference to pin to anything
 
  #6  
Old 09-24-14, 02:56 PM
F
Member
Join Date: May 2010
Location: USA
Posts: 514
Upvotes: 0
Received 49 Upvotes on 37 Posts
Create a shortcut to your batch file. Right-click on it and choose "create shortcut." Then move the shortcut to your desktop or to the tool bar or wherever you'd like.

The shortcut by default will have a generic icon, but you can customize it by right-clicking, choosing "properties" and "change icon." There are several files in the C:\Windows\System32 directory that contain icons you can use. The two I use icons from most commonly are moricons.dll and shell32.dll. If you don't find anything suitable in them, you also can try:

AccessibilityCpl.dll
compstui.dll
DDORes.dll
gameux.dll
ieframe.dll
imageres.dll
mmcndmgr.dll
mmRes.dll
NetCenter.dll
netshell.dll
networkexplorer.dll
pifmgr.dll
pnidui.dll
SensorsCpl.dll
setupapi.dll
wmploc.dll
wpdshext.dll


And you can shorten your batch file to two lines:

@echo off
"c:\program files (x86)\microsoft office\office10\excel.exe" "C:\Utility1\Home\Excel\Summary.xls"
 
  #7  
Old 09-24-14, 03:20 PM
kolias's Avatar
Member
Thread Starter
Join Date: Jul 2004
Location: Canada
Posts: 1,689
Received 9 Upvotes on 9 Posts
Thanks Fred for the tips but I did what your saying with no success, no way that shortcut will pin to the Taskbar but I was able to pin it to the start menu (ClassicShell) which is not too bad

I was aware about the icons in the files mentioned, very useful to ID directories and shortcuts
 
  #8  
Old 09-25-14, 10:24 AM
Z
Member
Join Date: Jan 2008
Location: Southeastern Pennsylvania
Posts: 3,386
Received 124 Upvotes on 115 Posts
You need a kludge:

1)Open notepad and save the empty file as some fake executable e.g., “Joe.exe”

2)Right click on “Joe.exe” and select “Pin to Taskbar”.

3) On task bar right click on "Joe" icon and then right click on “Joe” and then right click on “Properties”.

4) In “Target” box type path and file name of your BAT file.

5) At this time you can also use the “Change Icon” button to select an icon of your own choosing. (I think you might need to restart to see the icon change.)

p.s. I agree with Fred, you can get your bat file down to 2 lines, but let me be super picky (lol) – it is a better programming practice to have a positive indication that you actually intended to end where you did ( e.g.,REM or GOTO label, etc.).

Analogous to a period, without it the reader is never sure!
 
  #9  
Old 09-25-14, 12:33 PM
kolias's Avatar
Member
Thread Starter
Join Date: Jul 2004
Location: Canada
Posts: 1,689
Received 9 Upvotes on 9 Posts
Thanks zoesdad sound good your info but I gave up with Office2002 because the main problem was that if I click any .doc or .xls file in my explorer the file did not open and that was a big pain since I'm always working on the explorer to open any of my doc. At least I tried, LOL

Now I just installed Office Home/Student 2013 and started to learn the difficult ribbon bars
 
  #10  
Old 09-25-14, 02:12 PM
Z
Member
Join Date: Jan 2008
Location: Southeastern Pennsylvania
Posts: 3,386
Received 124 Upvotes on 115 Posts
Good luck with Office Home/Student 2013. I bet that’s probably a good move. I keep stuff forever .I was the last person on earth using Windows 95 then I jumped to Vista and now W7! lol But I do have Office Home/Student 2007.
 
  #11  
Old 09-25-14, 02:28 PM
S
Group Moderator
Join Date: Oct 2004
Location: WI/MN
Posts: 19,125
Received 1,263 Upvotes on 1,204 Posts
I've been using Windows 8.1 for most of the year and I now get frustrated when I have to work on a machine with the Windows 7/Server 2008 UI - I prefer 8.1 but it is different and does take some time to get used to it.

So far I haven't seen much in Office 2013 that makes a difference over 2010 but 2003 to 2007 was quite a change so I'm sure this is quite a bit different for you, kolias.
 
  #12  
Old 09-26-14, 03:42 AM
R
Member
Join Date: Apr 2007
Location: Near Buffalo, NY
Posts: 4,070
Upvotes: 0
Received 1 Upvote on 1 Post
Server you say? Right click and "Run as Administrator." If that works, right click properties, advanced and check the box to run as admin.
 
  #13  
Old 09-26-14, 03:14 PM
kolias's Avatar
Member
Thread Starter
Join Date: Jul 2004
Location: Canada
Posts: 1,689
Received 9 Upvotes on 9 Posts
Well zoesgag I had to use what you described in post #8 because even Excel2013 could make a shortcut of what I wanted in the Taskbar. Now all is fine and thanks for the tip
 
  #14  
Old 09-28-14, 08:44 AM
Z
Member
Join Date: Jan 2008
Location: Southeastern Pennsylvania
Posts: 3,386
Received 124 Upvotes on 115 Posts
Sure thing kolias. Glad I was of some help.
 
 

Thread Tools
Search this Thread
 
Ask a Question
Question Title:
Description:
Your question will be posted in: