MattBaldry
Self Taught, Learn from the Forums
- Local time
- Today, 15:50
- Joined
- Feb 5, 2019
- Messages
- 365
This is the batch file used for normal LAN operation.
This is the file used for Citrix or RDP oeration.Code:md c:\DwgLog del c:\DwgLog\DrawingLog.accdb copy "\\BSCCTIMBERLINE1\Timberline Office\AccessApps\Data\CommonFE\DrawingLog.accdb" c:\DwgLog c:\DwgLog\DrawingLog.accdb
Code:md %USERPROFILE%\DwgLog del %USERPROFILE%\DwgLog\DrawingLog.accdb copy "\\BSCCTIMBERLINE1\Timberline Office\AccessApps\Data\CommonFE\DrawingLog.accdb" %USERPROFILE%\DwgLog %USERPROFILE%\DwgLog\DrawingLog.accdb
The difference is that you can hard-code the target locations if you are running on a standard LAN but with the other environments, you need to use the users personal directory as the target location.
As you can see, there is no error checking code in the script. None is actually needed. If the directory already exists, the md doesn't raise an error and for the del, if the file doesn't exist, that also doesn't raise an error. I've seen scripts that go on for pages but this is all I've ever needed.
Thanks Pat