Start spreadsheet

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

nomad

Thread Starter
Joined
Sep 30, 1999
Messages
415
I have created a little batch file that copies and rename a spreadsheet from my desktop. I would like to open the spreadsheet after it is created but i just cant get it to work. below is what i have so far. Can anyone help me out.

Batch:
@Echo off
cls

set f=%date:~0,2%%date:~5,2%%date:~8,4%

set t=%time:~0,2%%time:~3,2%
set t=%t: =0%

mkdir "%f%-%t% - Stock"

copy "C:\Users\tom\Desktop\Purchase Order.xlsm" "%f%-%t% - Stock\%f%-%t% - Stock.xlsm"

cd "%f%-%t% - Stock"

start "%f%-%t% - Stock\%f%-%t% - Stock.xlsm"

for %%A in (".\..") do set dirname=%%~nA

C:\Windows\mkshortcut /target:"%cd%" /shortcut:"D:\Scaife Enterprise\_ActiveJobs\%dirname% - Stock__%f%-%t%"
 
Last edited by a moderator:
Joined
Mar 2, 2019
Messages
1,626
If you specify directory explicitly does that work?
Batch:
start /D "%f%-%t% - Stock" "%f%-%t% - Stock.xlsm"
If not try full path to directory.
 

nomad

Thread Starter
Joined
Sep 30, 1999
Messages
415
that doesn't seem to work for me. I cant use the full path as it changes every time create a new one.

thanx
 

Cookiegal

Karen
Administrator
Malware Specialist Coordinator
Joined
Aug 27, 2003
Messages
119,194
Nomad,

Please use code tags when posting code. As it was your code contained a link to another user's profile. Links won't parse when the proper code tags are used. I've edited your post accordingly. :)
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top