• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 396
  • Last Modified:

Batch File creation: Help Needed

I need some assistance in the creation of a batch file.

Lamens:

1. Batch file is run and the first thing it does is run a vbscript located in the same folder.
2. Once the vbscript is finished, the batch file restarts the machine.

I have a notion it has something to do with the exit code as to why my current script is not continuing after the .vbs has ran.  If I was not clear in any way forgive me, just ask and I will be glad to answer and additional questions you may have.

@Echo Off
cscript script.vbs
shutdown -r -c "Custom Message" -t 120

Open in new window

0
SOSTechteam
Asked:
SOSTechteam
  • 3
  • 2
3 Solutions
 
SysExpertCommented:
try
call cscript script.vbs

Otherwise the script may simply not ever reach the next line

alternatively use the shell command in your VBscript to do the shutdown.
 
I hope this helps !
0
 
Malli BoppeCommented:
The scriot works fine I have tested with a sample VB script.
It could be the problem with your VBscript which doesn't exit properly.
0
 
SOSTechteamAuthor Commented:
Thanks for the replies, I should have mentioned this, since I believe it is where the issue lies.

The users running the batch are not administrators, so they are unable to execute the 'shutdown' command.

Which leads me to a great question how can I get the batch file to run the shutdown command as administrator without having the password entered each time the batch is ran?
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
Malli BoppeCommented:
Are they running it on the local machine or through terminal services.
What error do they get.
0
 
SOSTechteamAuthor Commented:
Found a solution: using runasscp to execute the shutdown command has worked beautifully.
0
 
SOSTechteamAuthor Commented:
I was on the right track, but the admin rights is what was hanging me up.  Runasscp solved this issue and everything is gravy now.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now