/build/static/layout/Breadcrumb_cap_w.png

Scripting help

Ok. i've tried but i can't get this to work. So i'm asking for help.

I have a batch file that sets power configuration on an xp desktop. run locally, it works.

What's the best way to run this using the scripting module. ideally, i'd like to have it run at user login.

I've tried uploading the batch file as a dependency. Then i have set verify - nothing, on success- Launch “c:\windows\system32\cmd.exe” with params “ISPSpowercfg.bat”.

that's it. no joy though.

When i try to run it using the run now tool, it just sits in the "run now status" queue. under pushed 1/1 and completed 0/1. In fact there about 85 "script runs" for various things and all have pushed 1/1 and completed 0/1. Maybe somethings wrong with the kbox?

thanks for the help.

Matt

0 Comments   [ + ] Show comments

Answers (12)

Posted by: dtuttle 15 years ago
Purple Belt
0
If you have the Kbox script drop you batch file in the startup folder it will run... but if you do this it will run at every login....


I know in the registry there is a "run once"(ill see if I can link to it) - this will allow you to have something ... well run once at boot up. If I were you I would have you batch file make a log to confirm that it ran, in case you need to a 2nd trip, you know who would have it and who wouldn't
Posted by: lindsamw 15 years ago
Orange Senior Belt
0
In the scripting, just launch the batch file directly. Problem with that though, the kbox will run it under a different user context. So if its user specific settings, would probably want to read up on the registry Active Setup? I think its called. I use to do a lot of stuff with that and autoit.
Posted by: airwolf 15 years ago
Red Belt
0
Along the same lines as lindsamw's response, you an use AutoIT to write a wrapper to perform the registry modifications under a specific profile using RunAs. If you only want this to run once, you can have the logon script check for a custom registry key that it writes after successfully modifying the power settings.
Posted by: lindsamw 14 years ago
Orange Senior Belt
0
ya airwolf I used autoit to write my Active Setup registry keys. I don't use Active Setup enough its a handy trick for making sure something runs against a user, any user who ever logs into the box. Its easy to update too :) Theres a nice little article on it even here on appdeploy.com

http://itninja.com/blog/view/appdeploy:-articles:-activesetup
Posted by: tcasey 14 years ago
Senior Yellow Belt
0
Have you tried just copying the contents of your batch file into a "Run Batch File..." step in the "On Success" section?

If you are going to include your batch file as a dependency your parameter is going to have look something like: $(KACE_DEPENDENCY_DIR)\ISPSpowercfg.bat
Posted by: jirvine 14 years ago
Yellow Belt
0
In my scripting pane, under Verify, Step 1, I select "Run a batch file"and then copy the contents of my tested and working batch file into the code area. I don't select anything else. Then I just deploy that script. KBOX will run it silently so the user doesn't see a batch window. However, if you have other scripts that are not deploying, you may have other issues.
Posted by: wsteo 14 years ago
Senior Yellow Belt
0
Power management will be available in 5.1. Maybe, you do not need to write the script anymore.
Posted by: lindsamw 14 years ago
Orange Senior Belt
0
Was just going over some threads and noticed this, you would want the batch file launched on remediation and the verify step to always fail, or the "launch a program" option. Although that can be finicky with dos commands and things of that nature (including batch files). Check to make sure your bat file is getting downloaded to the clients. You can check that dependancies are getting downloaded C:\Program Files (x86)\KACE\KBOX\packages\kbots (drop the x86 part if your running on 32bit windows).

One other thing I would mention here, check out powercfg.exe ( http://technet.microsoft.com/en-us/library/cc748940(WS.10).aspx ) for configuring power options. Using powercfg.exe you can also make it a GPO that applies to users.

ORIGINAL: msandona



I've tried uploading the batch file as a dependency. Then i have set verify - nothing, on success- Launch “c:\windows\system32\cmd.exe” with params “ISPSpowercfg.bat”.


Posted by: GillySpy 14 years ago
7th Degree Black Belt
0
5.1 will also have the ability to specify a different RUN AS account for scripts.

But today scripts can update the HKEY_CURRENT_USER if a user is logged in so you set the script to run when a user is logged in and then modify the RUNONCE key for that user.
Posted by: BR0ck94 14 years ago
Yellow Belt
0
I am also having trouble with this. I have tried everything I can think of such as selecting "launch a program" "run a batch file" "attach the batch file as a dependency and then attempt to launch it"
Each time I'm stuck with pushed: 1/1 completed 0/1.

I don't believe that this should be this difficult. The batch file runs perfectly fine locally. I even tried the schtasks trick to runas an admin.
Posted by: jmoretti 14 years ago
Yellow Belt
0
Gerald, Power Mgmt and scripting with the ability to run as the local consol user are two things I need to be able to do soon with the Kbox. I'm very excited to see that these features wil be added to v5.1! Do you have an estimated timeline for its release?

Thanks!

-Joe Moretti
Posted by: KevinG 14 years ago
Red Belt
0
Add ISPSpowercfg.bat as a dependency

Launch a program...
Directory: $(KACE_DEPENDENCY_DIR)
File: ISPSpowercfg.bat

Check : Wait for startup

Parameters: *** Leave this blank
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ