• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Extendscript after effects how do i run this cmd command from my script simple one line command

Explorer ,
Jun 14, 2022 Jun 14, 2022

Copy link to clipboard

Copied

if i run this command on windows cmd

type "%localappdata%\temp\ClipBoard.txt" | clip

it copies all content of that txt to the clipboard excellent.

now, do I execute this command in extend-script without getting any script error popups or admins rights popups?

 

CopyClipboardd.onClick = function(){ 
var cmd, isWindows;
path = Folder.temp.fsName + "/ClipBoard.bat"
cmd = 'cmd.exe /c cmd.exe /c "echo type "%localappdata%\temp\ClipBoard.txt" | clip"';
system.callSystem(cmd);
}

 this is what I have cmd pops up but the code is not executing well I guess. kindly assist me asap anybody, please.

TOPICS
Expressions , Scripting

Views

630

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , Jun 14, 2022 Jun 14, 2022

Sorted fixed it only 1 \ made a difference

 

    CopyClipboardd.onClick = function(){ 
        
        //type "%localappdata%\temp\ClipBoard.txt" | clip
var cmd, isWindows;
var path;

copyTextToClipboard2(tbProp.text)
cmd = 'cmd.exe /c cmd.exe /c \" type "%localappdata%\\temp\\ClipBoard.txt" | clip"';
system.callSystem(cmd);

}

 

Votes

Translate

Translate
Explorer ,
Jun 14, 2022 Jun 14, 2022

Copy link to clipboard

Copied

cmd = 'cmd.exe /c cmd.exe /c "echo type "%localappdata%\\temp\\ClipBoard.txt" | clip"';
system.callSystem(cmd);

 

not working

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 14, 2022 Jun 14, 2022

Copy link to clipboard

Copied

The Windows command prompt/ scripting host itself runs with escalated permissions. In order to bypass any security warnings or dialogs you may need to mess with your group policies, create a special registry key or change the user level in your batch file and then invoke cmd. Nothing to do with AE, just how Windows works.

 

Mylenium

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 14, 2022 Jun 14, 2022

Copy link to clipboard

Copied

LATEST

Sorted fixed it only 1 \ made a difference

 

    CopyClipboardd.onClick = function(){ 
        
        //type "%localappdata%\temp\ClipBoard.txt" | clip
var cmd, isWindows;
var path;

copyTextToClipboard2(tbProp.text)
cmd = 'cmd.exe /c cmd.exe /c \" type "%localappdata%\\temp\\ClipBoard.txt" | clip"';
system.callSystem(cmd);

}

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines