Solved

Batch file to restart after running exe

Posted on 2010-08-13
3
616 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 69

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

If like me you are one who spends a lot of time working and scripting with cmd.exe, sometimes it is handy to be able to quickly view a calendar for a given month and year. This script will quickly do just that!  Save the code posted below to a .bat …
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

831 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