Jump to content

Run Another Program?


Recommended Posts

I have a simple need: run CCleaner with /auto /shutdown to shutdown the computer, but have ccleaner run another program before it shuts down my computer. I know you can run a vb script this way, but my program is not in visual basic. Perhaps I can sneak in another program by writing it is something to `clean' ?

Link to comment
Share on other sites

Well, if all else fails, you could run your program from the vbs script, using Windows Scripting Host?s WshShell.Run() method.

 

To run a .vbs script, the WSH must be enabled, though. (But it will probably be enabled anyway on about 90% of all systems out there. Sigh.)

Link to comment
Share on other sites

  • Moderators

To run a .vbs script, the WSH must be enabled, though. (But it will probably be enabled anyway on about 90% of all systems out there. Sigh.)

I have WSH disabled on my system so double clicking .VBS scripts won't work - however I can still launch my scripts using a command prompt or shortcut, like this example:

%windir%\system32\wscript.exe "E:\some folder\some scripts\script.vbs"

Link to comment
Share on other sites

Andavari: Good point. About in the Eighties, I swore never to touch BASIC again and, frankly, don?t like Microsoft?s BASIC variants at all, so I tend to forget about these things.

 

So if CCleaner somehow executes wscript.exe (or whatever equivalent function) when encountering "ScriptKeyX" (instead of just hoping some kind of shell will do the job), Howard could still reach his goal this way. A little clumsy, perhaps, but possibly working. One might have to try this out.

Link to comment
Share on other sites

My All User desktop has a SHUTDOWN link that launches my BAT script.

 

My script runs some odd jobs (including ERUNT registry backup) and then runs CCleaner in /AUTO /SHUTDOWN mode.

It all happens and the computer is shut down whilst I clean my teeth and prepare for bed.

 

Regards

Alan

Link to comment
Share on other sites

My All User desktop has a SHUTDOWN link that launches my BAT script.

 

My script runs some odd jobs (including ERUNT registry backup) and then runs CCleaner in /AUTO /SHUTDOWN mode.

It all happens and the computer is shut down whilst I clean my teeth and prepare for bed.

 

Regards

Alan

Yes I thought of this - I could actually, create a shortcut with a hotkey to a simple batch file, run my closing programs in it, run ccleaner /auto and even a final little program to shut down the computer, of which there are manu. Call my picky, but it seemed clumsy to start an einstance of the command shell, and run several programs -- when one program had a shutdown option. More artistic to use the one program to do closing tasks. But running a special shell, just to run a vb script, which itself just runs my program -- aint too artistic either!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.