[AccessD] Running Dir from Batch file in MS Access

Jim Lawrence accessd at shaw.ca
Sun Mar 12 22:53:57 CDT 2017


I have found it is a very powerful environment to work in.

The Windows power user shells can almost do anything. In fact before the power shell was really updated that was the way we would roll out an entire network, all desktops and servers. The current Windows shells are quite awesome and now the real power users have access to a full featured Bash shell. If you can get up to speed in this environment you will find that you can do extremely complex functions, complexity that you will not be able to do via the GUI, with just a few lines of code, very fast, with a full event log.  

Here is one example that I used to copy photos from Europe. The code only syncs the differences, logs-in remotely, via an ssh shell and key, through to a Domain server/desktop and secure router, using an encryption port, searches all sub-directories recursively and while building the same structure remotely and compressing the data in transit. Once the command was started it would run quietly in the background, noting and stepping over any errors and create a full log of all activity.

rsync -avz --progress ~/Pictures/portugal/* -e "ssh -p 38771" TheUsername at creativesystemdesigns.com:~/Pictures/portugal/

I have watched people who really know what they are doing, transferring all users and user credentials from on Exchange server to another or build a complete Active Directory on a new server...plus install all the appropriate updates through power shell scripts.

Using this inside of an instance of MS Access, could turn the little MDB into a network control center. ;-)
  
Jim  

----- Original Message -----
From: "jack drawbridge" <jackandpat.d at Gail.com>
To: "Access Developers discussion and problem solving" <accessd at databaseadvisors.com>
Sent: Sunday, March 12, 2017 3:56:39 PM
Subject: Re: [AccessD] Running Dir from Batch file in MS Access

Jim B,

Haven't worked  with bat or cmd for years (if I ever knew). My bat file
works if I type the bat file name into the command window  and I'm in the
directory where the bat file is stored.

The bat file does not create the output file when I try to run it from
Access shell as shown in earlier post.

The user has 1000's of images (all jpg) in various folders. I thought
running a Dir to build a file of the names of the jpgs would be a starting
point. Also, that running it from Access or scheduler or ??? might hide
some of the command prompt activity etc.

I'm looking to get a list of all jpgs that I can use to compare things
within Access. The user modifies and manipulates the jpgs, and needs to
know current files at any time.

Options welcome.
jack



On Sun, Mar 12, 2017 at 6:19 PM, Rocky Smolin <rockysmolin at bchacc.com>
wrote:

> I think you might be able to run a bat from the Shell command
>
> Rocky
>
>
> -----Original Message-----
> From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of
> jack drawbridge
> Sent: Sunday, March 12, 2017 1:09 PM
> To: Access Developers discussion and problem solving
> Subject: [AccessD] Running Dir from Batch file in MSAccess
>
> Jim,
>
> I was trying to respond and say I agree that its a fast method. However,
> the
> person I'm trying to help is not familiar with vba.
> I got a flag on your email saying it is marked as spam??
> So I'm starting again.
>
> I am not  experienced with Bat file from Access. I have had no luck with
> google nor the forums I participate in.
>
> I was trying to get a list of image files (jpg) and felt a simple Access
> form with a Shell cmd would hide most everything.
>
> But as always Simple has various meanings!!!
>
> jack
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com


More information about the AccessD mailing list