Jump to content

[Solved] Folder name with *.* in cmd


Recommended Posts

Hi guys, i need you help, again :D

I have a folder that changes everytime the name. Basically is:

test-test-123456789

The name test-test is equal everytime, the number 123456789 changes.

The problem is this: i have to use cmd for build a file in this directory. It's a simple script to avoid the MAX_LENGHT of cmd ( max 256 character limit )

The directory is:

@workingdir & "\test-test-123456789\build\test.sln

This is the script:

$var1 = "cd Windows\Microsoft.NET\Framework\v4.0.30319"
$var2 =
$var3 = @WorkingDir & $var2 & "\build\test.sln"
Run(@ComSpec)
Send(".cd C:\")
Send("{ENTER}")
Send($var1)
Send("{ENTER}")
Send($var3)

I don't know how to set $var2, because the name changes everytime.

I have also the same problem with directory of Framework ( v4.0.30319 ), but if i know how to set the variable for test-test i can apply for .NET directory

Thanks for support

Edited by johnmcloud
Link to comment
Share on other sites

Opt("ExpandEnvStrings", 1)    ;0=don't expand, 1=do expand
Opt("ExpandVarStrings", 1)    ;0=don't expand, 1=do expand
Run(@ComSpec)
winwaitactive("[class:ConsoleWindowClass]")
; change to frameworkdir
Send("cd %windir%Microsoft.NETFrameworkv{Tab}{ENTER}")
sleep (3000)
; change to test-test-dir
Send("cd @WorkingDir@test-test-{Tab}{ENTER}")
Send("cd buildtest.sln{ENTER}")

Edited by forumer100

App: Au3toCmd              UDF: _SingleScript()                             

Link to comment
Share on other sites

Opt("ExpandEnvStrings", 1)    ;0=don't expand, 1=do expand
Opt("ExpandVarStrings", 1)    ;0=don't expand, 1=do expand
Run(@ComSpec)
winwaitactive("[class:ConsoleWindowClass]")
; change to frameworkdir
Send("cd %windir%Microsoft.NETFrameworkv{Tab}{ENTER}")
sleep (3000)
; change to test-test-dir
Send("cd @WorkingDirtest-test-{Tab}{ENTER}")
Send("cd buildtest.sln{ENTER}")

Thanks for answer, the first part work fine :D

But the second not, because it will be:

C:WINDOWSMicrosoft.NETFrameworkv4.0.30319>MSBuild C:Documents and SettingsWindows XpDesktoptest-test-ffd119cbuildtest.sh

I need only 1 line, if you can help i'll be grateful

Edited by johnmcloud
Link to comment
Share on other sites

I'll update the script:

Opt("TrayIconHide", 1)
Opt("ExpandEnvStrings", 1)  ;0=don't expand, 1=do expand
Opt("ExpandVarStrings", 1)  ;0=don't expand, 1=do expand

$var1 = "test-test-ffd119c"
$var2 = "MSBuild" & " " & @WorkingDir & $var1 & "buildtest.sln"
Run(@ComSpec)
winwaitactive("[class:ConsoleWindowClass]")
Send("cd %windir%Microsoft.NETFrameworkv{Tab}{ENTER}")
Send($var2)

Work, but i need to set the variable for part "ffd119c" becouse it changes every update.

How to set this variable?

Edited by johnmcloud
Link to comment
Share on other sites

Opt("ExpandEnvStrings", 1)    ;0=don't expand, 1=do expand
Opt("ExpandVarStrings", 1)    ;0=don't expand, 1=do expand
Run(@ComSpec)
winwaitactive("[class:ConsoleWindowClass]")
; change to test-test dir
Send('cd "@DesktopDir@test-test-"{Tab}{ENTER}')
Send("cd build{ENTER}")
; remember test-test dir
Send("set MyDir=%cd%{ENTER}")
; change to frameworkdir
Send("cd %windir%Microsoft.NETFrameworkv{Tab}{ENTER}")
; call MSBuild
Send("MSBuild %MyDir%test.sh{ENTER}")

App: Au3toCmd              UDF: _SingleScript()                             

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

×
×
  • Create New...