Solved

Batch file to restart after running exe

Posted on 2010-08-13
3
613 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
3 Comments
 
LVL 6

Accepted Solution

by:
Dangle79 earned 167 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 68

Assisted Solution

by:Qlemo
Qlemo earned 167 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 166 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how to split this type of line? 5 83
Carriage Return in Batch File 5 36
xcopy loop 13 36
Modifying Powershell and WMI to obtain disk, cpu, mem & IP data ? 5 30
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…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

948 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now