[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 251
  • Last Modified:

cd command in script

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
rbeattie27
Asked:
rbeattie27
  • 2
  • 2
  • 2
  • +4
1 Solution
 
sysreq2000Commented:
Try cd \fix
0
 
Baddevildog82Commented:
Try the full path to \fix.  For example, c:\temp\Fix or \system32\fix

Let us know if that will work.
0
 
bootrebootCommented:
you can try a combination of lines:

cd \
cd fix
0
Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

 
rbeattie27Author Commented:
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
 
Lee W, MVPTechnology and Business Process AdvisorCommented:
Post a screen shot and include a DIR before the CD ".\fix" line.
0
 
Steve KnightIT ConsultancyCommented:
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
 
Steve KnightIT ConsultancyCommented:
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
 
oBdACommented:
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
 
bootrebootCommented:
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
 
rbeattie27Author Commented:
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

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

  • 2
  • 2
  • 2
  • +4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now