shell sommand issues....

GS7CLW

Banned
Joined
Aug 10, 2010
Messages
168
My macro has this in it which works:
Dim RetVal
RetVal = Shell("I:\S3DATA~1\FLRCDR~1\FloorR~1.bat", 1)

My batch file has this in it which works:
ECHO OFF
C:
cd..
z: ' network mapped Sharepoint site
CD \Shared Documents
del FloorReport.xlsm
copy I:\S3DATA~1\FLRCDR~1\FloorReport.xlsm

I am trying to eliminate the need for a batch file; so, I have tried:
Dim RetVal
Dim RetVal = shell("DEL Z:\Shared Documents\2011Buckeye.xlsm")
Dim RetVal = shell("copy /Y I:\S3DATA~1\FLRCDR~1\2011Buckeye.xlsm Z:\Shared Documents\2011Buckeye.xlsm")

but VBA says "file not found" on the DEL line above.

ANY ideas appreciated!

Hope everyone had a great week end --
not sure I did -- spent it putting Windows 7 on my home PC - uuuuugghhhh

cliff
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
The rest of the week has got to be great -- MONDAY is over!!!


I have tried this:

KillFile = "Z:\Shared~1\FloorReport.xlsm"
Kill KillFile
FileCopy "I:\S3DATA~1\FLRCDR~1\FloorReport.xlsm", "Z:\Shared~1\FloorReport.xlsm"

but I believe the fact that Z: is a network (mapped) drive it will not work.
I get a file not found on the Kill Killfile line.
 
Upvote 0

Forum statistics

Threads
1,224,541
Messages
6,179,418
Members
452,912
Latest member
alicemil

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top