Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

cd command in script

Posted on 2009-05-11
10
Medium Priority
?
248 Views
Last Modified: 2012-05-06
Using the script:

@ECHO ON
%windir%\system32\msiexec /i "Notes 8.0.2.msi" /qb /l* c:\notes8.txt
IF %ERRORLEVEL%==0 GOTO :fix ELSE EXIT /B %ERRORLEVEL%
:fix
cd ".\fix"
"Setup.exe" /v/q
IF %ERRORLEVEL%==0 GOTO :end ELSE EXIT /B %ERRORLEVEL%
PAUSE
EXIT

It installs "Notes 8.0.2.msi" fine, but then it errors at the line cd "./fix".  I've tried cd "fix" and even just cd fix.  Same error, "The system could find the path specified."  The fix\setup.exe is a service patch for Lotus Notes.
0
Comment
Question by:rbeattie27
[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
  • 2
  • 2
  • 2
  • +4
10 Comments
 
LVL 11

Expert Comment

by:sysreq2000
ID: 24357717
Try cd \fix
0
 
LVL 2

Expert Comment

by:Baddevildog82
ID: 24357726
Try the full path to \fix.  For example, c:\temp\Fix or \system32\fix

Let us know if that will work.
0
 
LVL 2

Expert Comment

by:bootreboot
ID: 24357744
you can try a combination of lines:

cd \
cd fix
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:rbeattie27
ID: 24357781
Sorry, I should of added this to the original post.  I'm trying to run this as a startup script and host the setup files on a server.  \\app2\netlogon\notes\install.bat is where this script is.  I think somehow it's getting messed up with it being on a network drive.

cd \fix
cd ".\fix"
cd fix

All do not work.
0
 
LVL 96

Expert Comment

by:Lee W, MVP
ID: 24357784
Post a screen shot and include a DIR before the CD ".\fix" line.
0
 
LVL 43

Accepted Solution

by:
Steve Knight earned 2000 total points
ID: 24357785
Are you running this from a "UNC" path, i.e. \\server\share\xyza\fix ?

If so the current directory is probably set to c:\windows\system32 or similar rather than the dir where your other bits are.  You an test that with

dir
echo %cd%
pause

(for example).  so there is no fix dir there..

If so suggest you code in the path to the setup too, i.e. \\server\share\whatever or map a drive in th script with a net use and run it from there.

Steve

fix\setup.exe /v /q
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 24357797
Crossed posts there then.... assuming the computer account has access to these files then from a startup script you will probably need to do:

net use x: /delete
net use x: \\app2\netlogon\notes
C:
cd \fix
setup.exe
(etc)
net use X: /delete
0
 
LVL 85

Expert Comment

by:oBdA
ID: 24357817
There's no need for "cd" or mapping drives; just specify the complete path to setup.exe, starting with the script's current folder:
"%~dp0fix\setup.exe" /v /q
"%~dp0" will expand to the script's drive and path, including the trailing backslash.
0
 
LVL 2

Expert Comment

by:bootreboot
ID: 24357835
you can map a temporary drive to it

@ECHO ON
%windir%\system32\msiexec /i "Notes 8.0.2.msi" /qb /l* c:\notes8.txt
IF %ERRORLEVEL%==0 GOTO :fix ELSE EXIT /B %ERRORLEVEL%
:fix
subst L: /D
net use L: /DELETE
net use L: \\server\share\
L:
cd \share\xyza\fix
"Setup.exe" /v/q
IF %ERRORLEVEL%==0 GOTO :end ELSE EXIT /B %ERRORLEVEL%
PAUSE
net use L: /DELETE
EXIT
0
 

Author Comment

by:rbeattie27
ID: 24357894
when I inserted the DIR command, it was C:\Windows

......................WORKING SOLUTION.......................
net use n: \\app2\netlogon\notes
%windir%\system32\msiexec /i "n:\Wessanen Notes 8.0.2.msi" /qb /l* c:\notes8.txt
IF %ERRORLEVEL%==0 GOTO :fix ELSE EXIT /B %ERRORLEVEL%
:fix
"n:\Fix\Setup.exe" /v/q
IF %ERRORLEVEL%==0 GOTO :end ELSE EXIT /B %ERRORLEVEL%
PAUSE
net use n: /del
EXIT
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
When you receive another warning that your shared drive is almost full and you have asked your users to clean out old files again and again, here is a single command that may help. This command will place all the files that have not been used rec…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Suggested Courses

730 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