Solved

Batch file to restart after running exe

Posted on 2010-08-13
3
611 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I have published numerous articles here at Experts Exchange that present programs/scripts written in a language called AutoHotkey. Each of those articles has a brief paragraph describing where to download the product and how to install it. I have al…
How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

744 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

8 Experts available now in Live!

Get 1:1 Help Now