Sign in to follow this  
Followers 0
Guest BinaryVision

Another @ComSpec Question...

7 posts in this topic

I have written a script to install SAS 9 in quiet mode, with lines such as the following:

RunWait(@ComSpec ' /c ' & @ScriptDir & '\Disk1\sas\setup.exe -s quietfile="' & @ScriptDir & '\sas9quiet.ini" -f2"C:\DEPLOY\SAS\SAS9QUIET.txt"')

Why am I unable to use such expressions with the @ComSpec macro? I read up on the Windows command shell and looked at some previous posts on this forum but I'm not quite sure what's wrong. Thanks!

Share this post


Link to post
Share on other sites



1st i would check the "outcome" of that line wiht a message box

2nd you might want to look at /k to see whats happening on the cmd screen

3rd you should look at the "Default directory"

4th many times i use FileGetShortName with any line that has a space in the directory such as @ScriptDir

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I might try something like this:

#include <Process.au3>

Dim $exe = @ScriptDir & '\Disk1\sas\setup.exe'
Dim $ini = @ScriptDir & '\sas9quiet.ini'

Dim $quotedExe = """" & $exe & """"
Dim $quotedIni = """" & $ini & """"

_RunDos($quotedExe & ' -s quitefile=' & $quotedIni & ' -f2 "C:\DEPLOY\SAS\SAS9QUIET.txt"')

Do you really need quotes around C:\DEPLOY\SAS\SAS9QUIET.txt ?

Edited by CyberSlug

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

If this is a Silent Installsheild Installation and you are installing from a non writable medium, such as a CD, then you are going to need to make a log file, else it will fail trying to write to the CD.

-f1 is the log file for Installsheild, so if it is Installsheild, then try this.

RunWait(@ScriptDir & '\Disk1\sas\setup.exe -s ' & _
        'quietfile="' & @ScriptDir & '\sas9quiet.ini" ' & _
        '-f1"' & @TempDir & '\SAS.log" ' & _
        '-f2"C:\DEPLOY\SAS\SAS9QUIET.txt"')

Edit:

Upon checking, I am mistaken. -f1 is the recorded file and -f2 is the log file for installsheild. So you are making the log file but without the recorded file, which would be using the quiet file for such a cause. Which could mean the problem is elsewhere. Sorry.

Edited by MHz

Share this post


Link to post
Share on other sites

I have written a script to install SAS 9 in quiet mode, with lines such as the following:

RunWait(@ComSpec ' /c ' & @ScriptDir & '\Disk1\sas\setup.exe -s quietfile="' & @ScriptDir & '\sas9quiet.ini" -f2"C:\DEPLOY\SAS\SAS9QUIET.txt"')

Why am I unable to use such expressions with the @ComSpec macro? I read up on the Windows command shell and looked at some previous posts on this forum but I'm not quite sure what's wrong. Thanks!

missing a '&' sign between @Comspec and ' /c'

Share this post


Link to post
Share on other sites

Might want to check single / double quotes. I still haven't figured out the magic of mixing and matching them.


Agreement is not necessary - thinking for one's self is!

My-Colors.jpg

cuniform2.gif

Share this post


Link to post
Share on other sites

missing a '&' sign between @Comspec and ' /c'

Yes, you were right! After all the time I spent trying to figure this out it was more or less a syntax error. Sorry for all the hassle. Probably edited the line and took out the & or just forgot to put it in, since this is the first time I have attempted to use the @ComSpec macro. I have previously used .bat files for multiple commands, however I suppose I could just use the " || " in the statement in those cases. I hate when this sort of thing happens, don't you? LOL. But to answer some previous questions, everything in my command follows the example in the administrator guide.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0