×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

please advice tried and tried lot times

please advice tried and tried lot times

please advice tried and tried lot times

(OP)
my $cod="c:\\Program\\ Files";


system("start $cod");

when i am doing this it throws error
the error indicates its not accepting space between program and files
but my path is c:\program files, there is space between program and files
tried lot of ways
finally popsting here
please help  

RE: please advice tried and tried lot times

This works:

CODE --> Perl

#!/usr/bin/perl -w
use strict;

my $cod="C:\\Program Files";
system("start \"Title\" \"$cod\"");

Note that when you quote the first parameter of the start command it assumes you are supplying a window title, which is why I had to include one (even though you don't actually see it).

Annihilannic
tgmlify - code syntax highlighting for your tek-tips posts

RE: please advice tried and tried lot times

(OP)
my $TSMBACKUPSTATEMENT="C:\\ProgramFiles\\Tivoli\\TSM\\TDPSql\\tdpsqlc\" backup $database FULL /sqlbuff=2 /strip=2 /SQLSERV=$servername";
system("start \"Title\" \"$TSMBACKUPSTATEMENT\"");

the above statement is executing fine but when i include one more line to store the output its not working :

my $TSMBACKUPSTATEMENT="C:\\Program Files\\Tivoli\\TSM\\TDPSql\\tdpsqlc\" backup $database FULL /sqlbuff=2 /strip=2 /SQLSERV=$servername >> C:\\dba\\test.out 2>&1" ;
system("start \"Title\" \"$TSMBACKUPSTATEMENT\"");

RE: please advice tried and tried lot times

(OP)
when i google it i found it can be accomplished using backtiks but i did not find anything on how to use it
please suggest for my code

RE: please advice tried and tried lot times

You have a \" after your tdpslc command, but none before it, and then another set around the whole commadn in your system() statement.  You need to do it in one place or the other, in this case it needs to be in the $TSMBACKUPSTATEMENT because the path is followed by other parameters.  This should work I think.

CODE

my $TSMBACKUPSTATEMENT="\"C:\\Program Files\\Tivoli\\TSM\\TDPSql\\tdpsqlc\" backup $database FULL /sqlbuff=2 /strip=2 /SQLSERV=$servername >> C:\\dba\\test.out 2>&1" ;
system("start \"Title\" $TSMBACKUPSTATEMENT");
 

Annihilannic
tgmlify - code syntax highlighting for your tek-tips posts

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close