Technical support and scripting issues
Moderators: JRL, Dorian (MJT support)
-
CyberCitizen
- Automation Wizard
- Posts: 724
- Joined: Sun Jun 20, 2004 7:06 am
- Location: Adelaide, South Australia
Post
by CyberCitizen » Tue Jun 07, 2016 4:04 am
Hi Guys,
Hoping its something small / simple I have been missing, but be trying for a couple of days trying to workout what is going on.
Code: Select all
GoSub>sDeleteFile
Let>INPUT_BROWSE=0
Input>vComputerName,Please Enter Part Of Asset / Computer Name,
Let>MSG_HEIGHT=320
Let>MSG_WIDTH=500
Let>MSG_STAYONTOP=1
Let>MSG_CENTERED=1
ExtractFileName>Command_Line,strFileName
ExtractFileExt>Command_Line,strExt
StringReplace>%strFileName%,",,strFileName
StringReplace>%strExt%,",,strExt
StringReplace>%strFileName%,%strExt%,,strFileName
Trim>%strFileName%,strFileName
Let>APP_TITLE=%strFileName%
Let>RP_WAIT=1
Let>RP_WINDOWMODE=1
RunProgram>%SYS_NATIVE%\cmd.exe /c dsquery.exe computer -name "*%vComputerName%*" > "%TEMP_DIR%ComputerName.txt"
ReadFile>%TEMP_DIR%ComputerName.txt,vContents
Separate>vContents,%CRLF%,aComputerNames
ArrayCount>aComputerNames,numItems
// ### SUBROUTINES ### //
SRT>sDeleteFile
IfFileExists>%TEMP_DIR%ComputerName.txt
DeleteFile>%TEMP_DIR%ComputerName.txt
EndIf
END>sDeleteFile
FIREFIGHTER
-
Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
-
Contact:
Post
by Marcus Tettmar » Tue Jun 07, 2016 2:27 pm
You don't say what the problem is?
-
CyberCitizen
- Automation Wizard
- Posts: 724
- Joined: Sun Jun 20, 2004 7:06 am
- Location: Adelaide, South Australia
Post
by CyberCitizen » Tue Jun 07, 2016 2:28 pm
Sorry showed the issue in the animated gif.
Basically when I run the command via ms it doesn't work, external it works. Same batch file.
Sent from my SM-T710 using Tapatalk
FIREFIGHTER
-
Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
-
Contact:
Post
by Marcus Tettmar » Tue Jun 07, 2016 3:55 pm
Don't see the gif. It's not loading. But usually this is down to quotes, or lack of. You might need e.g.:
%SYS_NATIVE%\cmd.exe /c "dsquery.exe computer -name "*%vComputerName%*" > "%TEMP_DIR%ComputerName.txt""
-
CyberCitizen
- Automation Wizard
- Posts: 724
- Joined: Sun Jun 20, 2004 7:06 am
- Location: Adelaide, South Australia
Post
by CyberCitizen » Tue Jun 07, 2016 3:59 pm
Thanks Marcus,
I can't test now for a few days but I am sure it's something simple like that I have been trying all sorts of different formats and quote positions trying to get it right. Hopefully that's the one I need.
Sent from my SM-T710 using Tapatalk
FIREFIGHTER