Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7884085
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T04:42:17+00:00 2026-06-03T04:42:17+00:00

Colls, I wrote a script which should: copy a file from C:\PR\DataFiles\Input\CL_CH5\+k+\ext_028042012.dat to C:\PR\DataFiles\Input\ext_028042012.dat

  • 0

Colls, I wrote a script which should:

  1. copy a file from C:\PR\DataFiles\Input\CL_CH5\”+k+”\ext_028042012.dat to C:\PR\DataFiles\Input\ext_028042012.dat – works fine

  2. run cmd.exe with specified command line (p.3)

  3. after runing cmd.exe, script should go to c: disk, than change directory to c:/pr, then write in cmd line «process.bat c:\pr ext_028042012.dat auto» and press Enter.

Code is:

 var fso = new ActiveXObject("Scripting.FileSystemObject");  
     for (var k = -2; k <= 0; k++)  
     {  
         var out_dir = "C:\\PROBE\\DataFiles\\Input\\CL_CH5";  
         // now i am copying a ext_028042012 to destination folder    
         fso.CopyFile("C:\\PR\\DataFiles\\Input\\CL_CH5\\"+k+"\\ext_028042012.dat",                                                                            
         "C:\\PR\\DataFiles\\Input\\ext_028042012.dat", 1);  
         WScript.Echo(k+"file copied.");  
         /*Block which run cmd window*/  
         //The following code should open a command window, changes to the path to C:\ ,   and executes the DIR command.
         var oShell = WScript.CreateObject ("WScript.Shell");  
         **oShell.run ("cmd /K cd c:\pr /K process.bat c:\ext_028042012.dat auto");**  
         WScript.Echo(k+ "file proceed!!!");
  1. Unfortunatly, it doesn’t work. Script doesn’t put command line from p.3 to opened cmd.exe window.
    Please, tell me where is my mistake. Thank you a lot.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T04:42:18+00:00Added an answer on June 3, 2026 at 4:42 am

    Your command string,

    "cmd /K cd c:\pr /K process.bat c:\ext_028042012.dat auto"
    

    looks erroneous. I don’t believe you can specify several /K commands like that – and since the meaning of /K is “Carry out the command and continue” never ending the first shell you launch.

    Have you tried:

    "cmd /K cd c:\pr && process.bat c:\ext_028042012.dat auto"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wrote a little Python script wrapcl.py script which wraps our compiler binary (
I am trying to write a script which will automate a copy/paste of employee
I've got a Javascript file which is automatically generated from a legacy app which
I have a python script which process a file line by line, if the
I wrote this script to delete rows which contain a value in column C
I have a small script we're using to read in a CSV file containing
I'm writing a python script that uses subprocess.Popen to execute two programs (from compiled
I want to write a script foo which simply calls bar with the exact
I have a PowerShell script that calls a CmdLet which in turn reports its
I'm trying to write an application which uses a lot of java script inside

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.