?
Solved

Batch file to restart after running exe

Posted on 2010-08-13
3
Medium Priority
?
620 Views
Last Modified: 2012-05-10
I have this script that's supposed to run an installation exe with switches, then restart the computer.
Is this the correct way to do it?
It seems to run the install on the XP machine and reboot, but the output  in DOS window says this:

'\\server1\deploy\CitrixClient'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported.  Defaulting to Windows directory.
Upgrading Citrix Client
Do not close this window. It will close when the installation is complete.


Also how do I add support to the code to reboot a vista computer, do I just add an additional line at the end that says shutdown /r /f /t 01?


Adding this to vbscript department also in case there's a vbscript out there that can do this better.

 
@ECHO OFF
ECHO Upgrading Citrix Client
ECHO Do not close this window. It will close when the installation is complete. 
\\server1\deploy\CitrixClient\CitrixOnlinePluginFull.exe /silent ADDLOCAL="ICA_Client,PN_Agent,SSON" ENABLE_SSON="yes" SERVER_LOCATION="http://server1"
shutdown -r -f -t 01

Open in new window

0
Comment
Question by:garryshape
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 6

Accepted Solution

by:
Dangle79 earned 668 total points
ID: 33430294
you can do with a batch file, just map the share to a drive first (net use X:) using a drive letter that's known not to be in use, then run your install from the mapped drive then disconnect the mapping (net use X: /YES /del) then reboot.
actually, since you're not mapping with a /persistent switch the reboot makes the disconnect unnecessary
0
 
LVL 70

Assisted Solution

by:Qlemo
Qlemo earned 668 total points
ID: 33430356
The message about the current directory does not matter. It appears if you use a UNC path as working directory - DOS cannot change directory to a UNC path, that is why the message appears. As long as you aren't using the current directory for anything, it does not matter.

With Vista (and above) you should provide a reason for shutting down with the   /d p:4:2   and    /c "Citrix installed"   parameters. I recommend to put two shutdown commands into your script, one for XP and older, one for Vista and more recent. One will fail, the other one run.
0
 
LVL 4

Assisted Solution

by:mop_se
mop_se earned 664 total points
ID: 33430364
You get the error because you run
\\server\share\script.cmd instead of X:\script.cmd

It's a warning, not an error. If you would like to hide it you could try:
@ECHO OFF
CLS
ECHO Upgrading Citrix Client
...

shutdown /r /f /t 01 works in XP also.
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

YESTERDAY YESTERDAY.BAT is inspired by a previous article I wrote entitled: TOMORROW.BAT (http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/MS_DOS/A_4196-Advanced-Batch-File-Programming-TOMORROW-BAT.html). The crux of this batch f…
AutoHotkey is an excellent, free, open source programming/scripting language for Windows. It started out as a keyboard/mouse macros product, but has expanded into a robust language. This article provides an introduction to it, with links to addition…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question