Solved

cd command in script

Posted on 2009-05-11
10
237 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
  • 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
 

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 95

Expert Comment

by:Lee W, MVP
ID: 24357784
Post a screen shot and include a DIR before the CD ".\fix" line.
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 43

Accepted Solution

by:
Steve Knight earned 500 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 83

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
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 …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

747 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

9 Experts available now in Live!

Get 1:1 Help Now