Jump to content

Command line help


Recommended Posts

Hi all, can anyone experienced man help me with this script string? I dunno why I cannot get the logfile on my desktop. Cmd line dissapears and no file appears!!! If you can do it with @ComSpec, please provide with it. Waiting for answer, - thanks!!

Run (@WindowsDir & "\system32\tasklist.exe " & @DesktopDir & ">tasklist.log")

Link to comment
Share on other sites

Run(@ComSpec & ' /c tasklist > "' & @ScriptDir & '\test.txt"')

You must enclose the path in double quotes because otherwise if the path contains spaces you'll delimit the file path by the first space.

tasklist > C:\Documents and Settings\User\Desktop\File.txt

is evaluated as tasklist > C:\Documents, so it'll create this file and output it there as long as there is not folder with that name/path.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...