Rick_Folsom
(Fresh Scripter)
2008-07-10 05:06 PM
Simply can't seem to get a RUN command to work.

I purchased EZAudit software to get a weekly audit of PC's and software titles for compliance, and their user's guide says to enter this command in my KiXtart login script:

RUN "\\your_server_name\ezaudit\ezstart.exe /auto"

When I put that in, nothing happens. When run from a RUN command on an individual PC, the command is "\\server_name\ezaudit\ezstart.exe" /auto, and that works fine. If I try to enter it as above in the login script, the login fails with an error. Finally, when I try to encase the above command in single quotes, ('"\\server_name\ezaudit\ezstart.exe" /auto') nothing happens.

Any ideas?


Kdyer
(KiX Supporter)
2008-07-10 05:16 PM
Re: Simply can't seem to get a RUN command to work.

Welcome,

What is "an error"? You need to tell us what "an error" is. It is like saying my car has a problem.. What is "a problem"? \:\)

What you can do is the following:

Do your users have the ability to access \\your_server_name\ezaudit if they run it from a command-line?

You need to make sure they have have execute permissions to that share called "ezaudit"..

If you are able to get there, then you may need to throw a couple of macros in your script like @ERROR and @SERROR to have it pipe back what the problem is.

HTH,

Kent


Rick_Folsom
(Fresh Scripter)
2008-07-10 05:47 PM
Re: Simply can't seem to get a RUN command to work.

Pop-up Box

KiXtart
ERROR: Error in expression.!
Script: C:\WINNT\System32\yupo.kix
Line: 98

That's what happens when the command entered in the script looks exactly like this: Run "\\yuponas\ezaudit\ezstart.exe" /auto

Yes, all users can run the command from their own PC's and have explicit modify etc. permission to the folders.


AllenAdministrator
(KiX Supporter)
2008-07-10 05:49 PM
Re: Simply can't seem to get a RUN command to work.

Try putting /auto inside the quotes.

Les
(KiX Master)
2008-07-10 06:08 PM
Re: Simply can't seem to get a RUN command to work.

Looks like he tried that.
 Quote:
Finally, when I try to encase the above command in single quotes, ('"\\server_name\ezaudit\ezstart.exe" /auto') nothing happens.


Try including COMSPEC or pushing the command to the RunOnce reg key instead.


Rick_Folsom
(Fresh Scripter)
2008-07-10 06:18 PM
Re: Simply can't seem to get a RUN command to work.

I've tried the COMSPEC shell routine and that fails (sorry, don't remember the message and probably won't retry it), and I've tried creating it as a CMD and running the CMD, all to no avail. Clueless on the "pushing the command to the RunOnce reg key instead" comment. The command works in quotes without the /auto, but then requests them to save the file on their own PC, which really does me no good.

I undestand that this is probably a failure on the EZAudit side, but I was hoping someone could tell me why

Run '"\\yuponas\ezaudit\ezstart.exe" /auto'

isn't a valid command in KiXtart, or how to turn

run "\\yuponas\ezaudit\ezstart.exe" /auto

into a command that will run through KiXtart.


AllenAdministrator
(KiX Supporter)
2008-07-10 07:07 PM
Re: Simply can't seem to get a RUN command to work.

I don't know what you tried, but it seems like this should work
run '%comspec% /c "\\yuponas\ezaudit\ezstart.exe" /auto'


Rick_Folsom
(Fresh Scripter)
2008-07-10 08:05 PM
Re: Simply can't seem to get a RUN command to work.

Thanks for your assistance all. After adding the compspec part, I get a message when the script runs telling me the command ran, but it still doesn't run the actual program. Strange stuff. I'll just continue walking to the PC's I guess.

Kdyer
(KiX Supporter)
2008-07-10 08:13 PM
Re: Simply can't seem to get a RUN command to work.

Did you try the options?
 Code:
run '%comspec% /c "\\yuponas\ezaudit\ezstart.exe" /auto' 
?@ERROR
?@SERROR

Or..
 Code:
SHELL '%comspec% /c "\\yuponas\ezaudit\ezstart.exe" /auto' 
?@ERROR
?@SERROR

Or..
 Code:
SHELL '%comspec% /c \\yuponas\ezaudit\ezstart.exe /auto' 
?@ERROR
?@SERROR

Or..
 Code:
RUN '%comspec% /c \\yuponas\ezaudit\ezstart.exe /auto' 
?@ERROR
?@SERROR

Or..
 Code:
RUN '%comspec% /c /e:on \\yuponas\ezaudit\ezstart.exe /auto' 
?@ERROR
?@SERROR

Or..
 Code:
$EXEPATH="\\yuponas\ezaudit\ezstart.exe"
RUN '%comspec% /c '++' /auto' 
?@ERROR
?@SERROR


HTH,

Kent


Rick_Folsom
(Fresh Scripter)
2008-07-10 09:45 PM
Re: Simply can't seem to get a RUN command to work.

run '%comspec% /c "\\yuponas\ezaudit\ezstart.exe" /auto'
No error messages, no audit.

SHELL '%comspec% /c "\\yuponas\ezaudit\ezstart.exe" /auto'
CMD.EXE was started as the above path in current directory, UNC not supported

SHELL '%comspec% /c \\yuponas\ezaudit\ezstart.exe /auto'
Same as above

RUN '%comspec% /c \\yuponas\ezaudit\ezstart.exe /auto'
No error, no audit.

RUN '%comspec% /c /e:on \\yuponas\ezaudit\ezstart.exe /auto'
No error, no audit.\

$EXEPATH="\\yuponas\ezaudit\ezstart.exe"
RUN '%comspec% /c '++' /auto'
Flashed by too fast to see, but there was some type of memory error.


Kdyer
(KiX Supporter)
2008-07-10 10:46 PM
Re: Simply can't seem to get a RUN command to work.

Rick,

Went to: http://www.ezaudit.com/guide/lanwan.htm

Note: The information of how to run this application using START.

Under the KiXtart Section, they say to do:
 Quote:

KixTart
RUN "\\your_server_name\ezaudit\ezstart.exe /auto"

In some environments, the syntax may have to include the %comspec% command:

Shell “%comspec% /c start \\your_server_name\ezaudit\ezstart.exe /auto”
Note that ezstart.exe takes under 5 seconds to launch and terminate, so either is appropriate and won't hang up your logon script.


So..
 Code:
RUN "\\yuponas\ezaudit\ezstart.exe /auto"


Or..
 Code:
Shell "%comspec% /c start \\yuponas\ezaudit\ezstart.exe /auto"


If you want to see what is going on..
 Code:
Shell "%comspec% /c start \\yuponas\ezaudit\ezstart.exe /auto"
?@ERROR
?@SERROR
Get $
?'Press a key to continue'



Thanks,

Kent


Glenn BarnasAdministrator
(KiX Supporter)
2008-07-10 11:12 PM
Re: Simply can't seem to get a RUN command to work.

Shell requires a single string argument. Many of the examples you posted define multiple arguments. Please try the following, which is a strongly recommended method for using Shell/Run:
 Code:
$Cmd = '%COMSPEC% /c'
$Cmd = $Cmd + ' "\\yuponas\ezaudit\ezstart.exe" /auto'
$Cmd = $Cmd + ' >c:\temp\result.log 2>c:\temp\error.log'
'About to run ' $Cmd ?
Shell $Cmd

  • The double quotes in line 2 are not required unless there are spaces in your command path - having them there will not hurt.
  • The redirects in line 3 should be adjusted to reference a writable location on the client system. Any output and errors from the EZStart.exe will be written to the logs, so you don't have to be an Evelyn Wood graduate. ;\)
  • Line 4 displays the command before it is run - this can later be commented out, but it gives you a chance during development to verify that the command was constructed properly.
  • Shell can be replaced with Run without consequence, as long as you understand the difference in execution method. You will NOT be able to get entirely accurate results with the ERROR macros with Run, as they will only report a failure to locate or start the defined command. They will not report the result of its execution.
  • Note the use of leading spaces as the cmd string is built!

Glenn


Rick_Folsom
(Fresh Scripter)
2008-07-11 02:41 PM
Re: Simply can't seem to get a RUN command to work.

First to Kent. I have tried those two forms, with the first one being copied directly from their site, with modification to your_server_name, of course, with no luck. And on my system, SHELL in the logon script always causes an error.

To Glenn, I did something very similar to what you show. I found it in one of the forums (fori, fora?) but I don't think I tried the comspec peice, just created the CMD to be '"\\yuponas\ezaudit\ezstart.exe" /auto' and ran the command. The message "about to run \\yuponas\...." shows up fine, but again, the actual program never runs.

Some explanation of the environment: the logon script runs on our domain controller, and just before the attempt to run ezaudit, the script adds yuponas as a mapped drive. The messages saying yuponas has been added always show up. The next command is the run.

Question about the KiXtart script: could the issue be about where the two objects reside? I am assuming that the script basically runs locally on the PC that's logging on, which has access to yuponas by the time the run command is supposed to be executed. Nothing in the ezaudit literature says I have to have any executable on the PC's themselves. Just kind of rambling here, but ezaudit folks say they've got 10,000 users and have very few calls to their support desk, so I'm missing something here.


Glenn BarnasAdministrator
(KiX Supporter)
2008-07-11 07:49 PM
Re: Simply can't seem to get a RUN command to work.

The comspec is required in order to redirect the output of the command to the log files. Did you try that? did anything show up in the log files that might lend additional clues? If you're redirecting to log files, you won't see any output on the screen. Also, since this is a login process, I'd try Shell instead of Run, so it's synchronous. I've not used Run in the login script for anything that takes more than a second or two to execute, so I'm not sure of any consequence on the children when the parent process exits. I assume your executable taks a bit of time to run.

Another diagnostic step - Create a batch file in the same folder. The batch file should just write the time to a log file (time /t > .\startlog.txt). Execute the batch file just before you execute your installer. That will validate that the drive is mapped and you can execute objects on that share.

If you're mapping a drive to the executable location, why are you using UNC syntax to specify the command path? If you
net use x: \\server\share
your command line should be something like
x:\ezaudit\exstart.exe

Hmm... "ezstart"??? \:o Don't seem to be this time! ;\)

Last thing - please try my example exactly as shown. Only modify paths to suit your environment. If it fails, post the logs that it generates.

Glenn



Rick_Folsom
(Fresh Scripter)
2008-07-11 09:03 PM
Re: Simply can't seem to get a RUN command to work.

Glenn:

Basically the same result. Using the SHELL causes the error listed previously about CMD.exe executed, UNC not supported. The error and result log files were created, but empty. I'll try to execute it from the mapped drive vs. the UNC.


Rick_Folsom
(Fresh Scripter)
2008-07-11 09:31 PM
Re: Simply can't seem to get a RUN command to work.

Used the command y:\ezaudit\ezstart.exe annd the error log said path not found.

I'd like to find someone that uses ez-audit and KiXtart and see what they do, because this just isn't worth the struggle.


NTDOCAdministrator
(KiX Master)
2008-07-11 10:12 PM
Re: Simply can't seem to get a RUN command to work.

Well would like to help but after reading this
 Quote:
Prices start at just USD $149.95

, not sure we can do much else for you except trial and error. I have been using KiXtart now for over 6 years and in that time I've seen thousands of posts and I can only recall maybe 1 or 2 applications that would not run from a shell of KiXtart.
Those though would not run from a DOS batch file either. The point being that there must be something maybe being overlooked or not written correctly.

Glenn is VERY good at coding and debugging so please follow his examples and also put in debugging statements to see the exact error messages and track it down.


Glenn BarnasAdministrator
(KiX Supporter)
2008-07-11 11:52 PM
Re: Simply can't seem to get a RUN command to work.

The error message is very helpful, actually.

When you say "Y:\folder\file.exe", you tell the O/S to run "file.exe", which is found in the path "Y:\folder". Just because you tell the O/S where the file that you want to run is , it doesn't mean it will go there and then run the file, it just means it will run that file while sitting right where it is (in it's favorite easy chai - um - folder.

The message is most likely coming from the installer, not the OS. So - get a little more complex - Create a batch file to run the installer - EasyStart.BAT. It should look something like
 Code:
@Echo Off
Y:
CD \EasyAudit
.\EasyStart.exe (plus any needed args) >C:/temp/install.log 2>C:\Temp\error.log

This assumes that you mapped the drive to Y: in Kix before running this command via
Shell "Y:\EasyAudit\EasyStart.bat"

If that works, you can think about doing these commands in Kix if you wish, but using the bat file will let you test outside of kix. That's important when debugging and you're not sure if the problem is Kix, the environment, or the application you're launching.

I had an issue this past Tuesday where an install failed because there was a space in the path defined by %TEMP%. Spent a while looking at my Kix script before I started running the commands manually. Really tough, because no error wass generated, the process just exited silently. Basically, it pays to break your logic into managable chunks, even outside of your core process.

Glenn


Les
(KiX Master)
2008-07-12 12:33 AM
Re: Simply can't seem to get a RUN command to work.

Why not try the RunOnce key?

Arend_
(MM club member)
2008-07-13 01:42 PM
Re: Simply can't seem to get a RUN command to work.

How About:
 Code:
$objShell = CreateObject("WScript.Shell")
$objShell.Run("\\yuponas\ezaudit\ezstart.exe /auto")


Glenn BarnasAdministrator
(KiX Supporter)
2008-07-13 02:12 PM
Re: Simply can't seem to get a RUN command to work.

There are two issues that need to be resolved before trying alternate script start methods...

The first is the proper command syntax, which finally seems to have been resolved. Without that, RunOnce and WScript methods would fail just the same.

The second issue is the behavior of the install command after it has successfully been invoked. Using the syntax I recommended, with redirection to status and error logs, we can determine what's going on. Rick stated that "the error log said path not found" - If you post the actual data from the logs, instead of a vague interpretation, we could determine where that message is coming from.

If you get a message like:
 Code:
'c:\temp\junk.exe' is not recognized as an internal or external command, operable program or batch file.

its coming from the operating system, and you need to check your code to be sure that the mapped drive is available and you're specifying the correct location for the command. However, if you get a different message that states that some file can't be found, it's more likely that my prior explanation is appropriate - you are running the install command, but it can't find the rest of the files it needs to complete the install. You'll need to map the drive, make that drive active, CD to the install folder, and THEN run the install command.

Hey - waitaminute!!

Your initial command was "\\server\ezaudit\ezstart.exe". Then you say you mapped the drive to "Y:", and then ran "\ezaudit\ezstart.exe". Isn't "ezaudit" the share name? If it is, all you need to do is go to the ROOT of Y: and run "ezatart.exe" with your args. However, if "ezaudit" is not shared, it would explain why none of the UNC paths work.
What is the server name?
What is the share name?
If you map the drive to that share manually, what do you see when you run DIR? (post the actual command output, please)

Glenn


Arend_
(MM club member)
2008-07-14 10:01 AM
Re: Simply can't seem to get a RUN command to work.

Since this is not tech support, and Glenn does tend to make things overly complicated...

Could you please try the following:
- Copy the .exe file (and the rest from the exaudit dir) to a location on your C: Drive and just double click it. If that fails then you have a problem that kix cannot solve.

If it works:
- Copy the .exe file (and the rest from the exaudit dir) to a location on the network and just double click it from there. If that fails then you know it is network related.


Richard H.Administrator
(KiX Supporter)
2008-07-14 10:45 AM
Re: Simply can't seem to get a RUN command to work.

I second Glenns comment about where the program is running.

Make sure that you change to a real drive letter (local or mapped) before starting the program (use the GO command in KiXtart). It doesn't have to be the drive that the software is installed on, the local hard drive will be fine.

The reason is that some software simply does not like being started by a process whose locale is not a device - some give a reasonable message (like UNC being invalid) and some will just fail silently.


Kdyer
(KiX Supporter)
2008-07-14 07:55 PM
Re: Simply can't seem to get a RUN command to work.

 Originally Posted By: Glenn Barnas
Your initial command was "\\server\ezaudit\ezstart.exe". Then you say you mapped the drive to "Y:", and then ran "\ezaudit\ezstart.exe". Isn't "ezaudit" the share name? If it is, all you need to do is go to the ROOT of Y: and run "ezatart.exe" with your args. However, if "ezaudit" is not shared, it would explain why none of the UNC paths work.
What is the server name?
What is the share name?
If you map the drive to that share manually, what do you see when you run DIR? (post the actual command output, please)


One thing that comes to mind with Glenn's comments - Are you using the Z: Drive at all? The reason I ask is that there are some programs that use the Z: drive..

Kent


cwick
(Fresh Scripter)
2008-07-30 09:39 PM
Re: Simply can't seem to get a RUN command to work.

We actually use EZAudit here. This is the command from our login script

RUN "%COMSPEC% /c o:\ezaudit\ezscan.exe auto"

The O drive is mapped to a share on our server using the USE command.

Hope this helps.
Chad


AllenAdministrator
(KiX Supporter)
2008-07-30 10:07 PM
Re: Simply can't seem to get a RUN command to work.

No slash. Ahh. It's always the simple stuff everyone overlooks, but I guess in this case, unless you used that software, you wouldn't know it. Thanks for clearing that up.