Solved

Batch file to restart after running exe

Posted on 2010-08-13
3
619 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 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 70

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
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…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

717 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