By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,493 Members | 1,351 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,493 IT Pros & Developers. It's quick & easy.

Anyone made a program that can remotely shut down a PC in Access?

anoble1
100+
P: 223
Anyone made a program that can remotely shut down a PC in Access?

I saw the Microsoft automation message when you go to CMD and hit : Shutdown -i
I wanted that format in an Access DB, was wondering if anyone has made anything like that? I was wanting to do that customly in access

Thanks,

Attached Images
File Type: jpg box.jpg (40.8 KB, 332 views)
Oct 31 '12 #1
Share this Question
Share on Google+
8 Replies


Rabbit
Expert Mod 10K+
P: 12,315
Here is a link to window's documentation on the shutdown command: http://www.microsoft.com/resources/d....mspx?mfr=true.
Oct 31 '12 #2

zmbd
Expert Mod 5K+
P: 5,287
one cavet... in Win-Vista and Win-7 enterprise, the IT can disallow that command in various ways...
I used to use it an idle time log-out for my workstation under sceduled tasks on idle... IT upgraded us to Win7 and now it doesn't work as IT has dis-allowed the un-attened and script execution.
Oct 31 '12 #3

NeoPa
Expert Mod 15k+
P: 31,186
I assume you already know that you can use Shell() to invoke any command line utility?
Oct 31 '12 #4

anoble1
100+
P: 223
Yeah, works differently in windows 7. But, I as wanting some code that could intertwine with Windows where I could connect to a PC, and perform commands in MS Access. That way I could customize it. Wish I was smarter!
Nov 1 '12 #5

NeoPa
Expert Mod 15k+
P: 31,186
There are ways of interfacing with Windows directly using the API. However, that is some of the most complicated coding for a VBA programmer (as VBA was designed to use a somewhat different interface than the standard (C-type) interface used by Windows. Module to Read From the Windows Registry is a small example of some of the things needed even for something very straightforward. I have no idea what is available within Windows, mind you, for handling shutdowns.

On the other hand, you can also take pretty full control from within Access itself by building your CMD files from the project itself before executing them and then deleting them. I keep my CMD files in a table called tblCMD. I export them on the fly into the same folder that the database is in and then run them (Generally using my ShellWait() Function, but Shell can also work for you.) then I delete them after they've done their work.
Nov 1 '12 #6

anoble1
100+
P: 223
I think my head just exploded
Nov 1 '12 #7

Rabbit
Expert Mod 10K+
P: 12,315
For remote shutdowns in Windows, the two options that I know of is to use the shutdown command line tool and using a WMI object. There are probably other options as well.
Nov 1 '12 #8

NeoPa
Expert Mod 15k+
P: 31,186
ANoble:
I think my head just exploded
Sorry if my explanations are somewhat complicated. TBF the subject matter is not too trivial, so covering it for the inexperienced is a bit tough.

If you can identify which part(s) of the process you're having difficulty with though, I can deal more directly with that specific part. Hopefully in an easier manner to understand.
Nov 2 '12 #9

Post your reply

Sign in to post your reply or Sign up for a free account.